Merge ~canonical-kernel-team/+git/autotest-client-tests:jacobmartin/fio-gib-outval into ~canonical-kernel-team/+git/autotest-client-tests:master

Proposed by Jacob Martin
Status: Merged
Merge reported by: Po-Hsu Lin
Merged at revision: 25933c9c7a580acb766dc972a230451dcc8edbfe
Proposed branch: ~canonical-kernel-team/+git/autotest-client-tests:jacobmartin/fio-gib-outval
Merge into: ~canonical-kernel-team/+git/autotest-client-tests:master
Diff against target: 48 lines (+12/-7)
1 file modified
ubuntu_performance_fio/ubuntu_performance_fio.py (+12/-7)
Reviewer Review Type Date Requested Status
Po-Hsu Lin Approve
Review via email: mp+466763@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

If 'rd_bandwidth_per_sec' can be found in values[i], 'rd_bandwidth_gib_per_sec' will be there too (so as wr)
LGTM.

review: Approve
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Applied and pushed, thanks.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/ubuntu_performance_fio/ubuntu_performance_fio.py b/ubuntu_performance_fio/ubuntu_performance_fio.py
2index f80c0ed..8c53ffc 100644
3--- a/ubuntu_performance_fio/ubuntu_performance_fio.py
4+++ b/ubuntu_performance_fio/ubuntu_performance_fio.py
5@@ -367,14 +367,17 @@ class ubuntu_performance_fio(test.test):
6 for l in results.splitlines():
7 for s in l.split():
8 if s.startswith("BW="):
9- bw = float(re.findall(r"[-+]?\d*\.*\d+", s)[0])
10- if "read: " in l:
11- values['rd_bandwidth_per_sec'] = bw
12- if "write: " in l:
13- values['wr_bandwidth_per_sec'] = bw
14+ bw_scaled = float(re.findall(r"[-+]?\d*\.*\d+", s)[0])
15+ bw_kb = bw_scaled
16 for sc in kb_scale:
17 if sc in s:
18- bw = bw * kb_scale[sc]
19+ bw_kb = bw_scaled * kb_scale[sc]
20+ if "read: " in l:
21+ values['rd_bandwidth_per_sec'] = bw_scaled
22+ values['rd_bandwidth_gib_per_sec'] = bw_kb / kb_scale['GiB']
23+ if "write: " in l:
24+ values['wr_bandwidth_per_sec'] = bw_scaled
25+ values['wr_bandwidth_gib_per_sec'] = bw_kb / kb_scale['GiB']
26
27 idx_avg = l.find("avg=")
28 idx_stdev = l.find("stdev=")
29@@ -390,7 +393,7 @@ class ubuntu_performance_fio(test.test):
30 testname = testname.replace("-","_")
31
32 values['file_size_mb'] = file_size_mb
33- values['bandwidth_kb_per_sec'] = bw
34+ values['bandwidth_kb_per_sec'] = bw_kb
35 values['latency_usec_average'] = avg
36 values['latency_stddev'] = stdev
37
38@@ -414,8 +417,10 @@ class ubuntu_performance_fio(test.test):
39 print("fio_%s%s_%s_file_size_mb[%d] %s" % (media, config, testname, i, values[i]['file_size_mb']))
40 if 'rd_bandwidth_per_sec' in values[i] and 'testname' in values[i]:
41 print("fio_%s%s_%s,rd_bandwidth_per_sec[%d] %.2f" % (media, config, values[i]['testname'], i, values[i]['rd_bandwidth_per_sec']))
42+ print("fio_%s%s_%s,rd_bandwidth_gib_per_sec[%d] %.2f" % (media, config, values[i]['testname'], i, values[i]['rd_bandwidth_gib_per_sec']))
43 if 'wr_bandwidth_per_sec' in values[i] and 'testname' in values[i]:
44 print("fio_%s%s_%s,wr_bandwidth_per_sec[%d] %.2f" % (media, config, values[i]['testname'], i, values[i]['wr_bandwidth_per_sec']))
45+ print("fio_%s%s_%s,wr_bandwidth_gib_per_sec[%d] %.2f" % (media, config, values[i]['testname'], i, values[i]['wr_bandwidth_gib_per_sec']))
46 print("fio_%s%s_%s_bandwidth_kb_per_sec[%d] %.2f" % (media, config, testname, i, values[i]['bandwidth_kb_per_sec']))
47 print("fio_%s%s_%s_latency_usec_average[%d] %.2f" % (media, config, testname, i, values[i]['latency_usec_average']))
48 print("fio_%s%s_%s_latency_stddev[%d] %.2f" % (media, config, testname, i, values[i]['latency_stddev']))

Subscribers

People subscribed via source and target branches

to all changes: