From 080dea3ed5dca2a72258811cf6522ed69b11ffff Mon Sep 17 00:00:00 2001 From: zhihui wu Date: Tue, 13 Mar 2018 09:56:09 +0800 Subject: Delete part of code under qtip/legacy These code is obsolete. Change-Id: I0fc2b12847aaa30f713cf7578a92aae912153dd6 Signed-off-by: zhihui wu --- legacy/utils/transform/iperf_transform.py | 35 ------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 legacy/utils/transform/iperf_transform.py (limited to 'legacy/utils/transform/iperf_transform.py') diff --git a/legacy/utils/transform/iperf_transform.py b/legacy/utils/transform/iperf_transform.py deleted file mode 100644 index c5eef6f5..00000000 --- a/legacy/utils/transform/iperf_transform.py +++ /dev/null @@ -1,35 +0,0 @@ -############################################################################## -# Copyright (c) 2017 ZTE Corporation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## -import json -import datetime -import pickle -with open('iperf_raw.json', 'r') as ifile: - raw_iperf_data = json.loads(ifile.read().rstrip()) - -bits_sent = raw_iperf_data['end']['sum_sent']['bits_per_second'] -bits_received = raw_iperf_data['end']['sum_received']['bits_per_second'] -total_byte_sent = raw_iperf_data['end']['sum_sent']['bytes'] -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'] - -time_stamp = str(datetime.datetime.utcnow().isoformat()) - -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)) - -with open('./result_temp', 'w+') as result_file: - pickle.dump(result, result_file) -- cgit 1.2.3-korg