diff options
author | 2016-09-23 11:38:35 +0800 | |
---|---|---|
committer | 2016-09-25 10:56:22 +0800 | |
commit | 2b172eef7185382ed4283d1868896626ae3ef5f1 (patch) | |
tree | 7242ad699db6876264c9ac60f36763cc47f04ad1 /benchmarks/playbooks/result_transform/iperf | |
parent | c806bbde071596f204782e7182a65173798ad3ca (diff) |
Change result keys to lower-case and remove ' .'
QTIP-93
Change-Id: I125163e05b49d9631838e89571d59a967252292e
Signed-off-by: zhifeng.jiang <jiang.zhifeng@zte.com.cn>
Diffstat (limited to 'benchmarks/playbooks/result_transform/iperf')
-rw-r--r-- | benchmarks/playbooks/result_transform/iperf/iperf_transform.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/benchmarks/playbooks/result_transform/iperf/iperf_transform.py b/benchmarks/playbooks/result_transform/iperf/iperf_transform.py index 8df5a79a..b52e4634 100644 --- a/benchmarks/playbooks/result_transform/iperf/iperf_transform.py +++ b/benchmarks/playbooks/result_transform/iperf/iperf_transform.py @@ -11,16 +11,14 @@ total_byte_received = raw_iperf_data['end']['sum_received']['bytes'] cpu_host_total_percent = raw_iperf_data['end']['cpu_utilization_percent']['host_total']
cpu_remote_total_percent = raw_iperf_data['end']['cpu_utilization_percent']['remote_total']
-result = {}
time_stamp = str(datetime.datetime.utcnow().isoformat())
-result['1. Version'] = raw_iperf_data['start']['version']
-result['2. Bandwidth'] = {}
-result['2. Bandwidth']['1. throughput Sender (b/s)'] = bits_sent
-result['2. Bandwidth']['2. throughput Received (b/s)'] = bits_received
-result['3. CPU'] = {}
-result['3. CPU']['1. CPU host total (%)'] = cpu_host_total_percent
-result['3. CPU']['2. CPU remote total (%)'] = cpu_remote_total_percent
+result = {'version': raw_iperf_data['start']['version'],
+ 'bandwidth': {'sender_throughput': bits_sent,
+ 'received_throughput': bits_received},
+ 'cpu': {'cpu_host': cpu_host_total_percent,
+ 'cpu_remote': cpu_remote_total_percent}
+ }
with open('iperf_raw-' + time_stamp + '.log', 'w+') as ofile:
ofile.write(json.dumps(raw_iperf_data))
|