diff options
Diffstat (limited to 'legacy/utils/transform')
-rw-r--r-- | legacy/utils/transform/__init__.py | 0 | ||||
-rw-r--r-- | legacy/utils/transform/dpi_transform.py | 55 | ||||
-rw-r--r-- | legacy/utils/transform/final_report.py | 32 | ||||
-rw-r--r-- | legacy/utils/transform/fio_transform.py | 37 | ||||
-rw-r--r-- | legacy/utils/transform/iperf_transform.py | 35 | ||||
-rw-r--r-- | legacy/utils/transform/ramspeed_transform.py | 49 | ||||
-rw-r--r-- | legacy/utils/transform/ssl_transform.py | 62 | ||||
-rw-r--r-- | legacy/utils/transform/ubench_transform.py | 40 |
8 files changed, 0 insertions, 310 deletions
diff --git a/legacy/utils/transform/__init__.py b/legacy/utils/transform/__init__.py deleted file mode 100644 index e69de29b..00000000 --- a/legacy/utils/transform/__init__.py +++ /dev/null diff --git a/legacy/utils/transform/dpi_transform.py b/legacy/utils/transform/dpi_transform.py deleted file mode 100644 index bc837311..00000000 --- a/legacy/utils/transform/dpi_transform.py +++ /dev/null @@ -1,55 +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 os -import pickle -import datetime - -sum_dpi_pps = float(0) -sum_dpi_bps = float(0) - -for x in range(1, 11): - dpi_result_pps = float( - os.popen( - "cat $HOME/qtip_result/dpi_dump.txt | grep 'nDPI throughput:' | awk 'NR=='" + - str(x) + - " | awk '{print $3}'").read().lstrip()) - dpi_result_bps = float( - os.popen( - "cat $HOME/qtip_result/dpi_dump.txt | grep 'nDPI throughput:' | awk 'NR=='" + - str(x) + - " | awk '{print $7}'").read().rstrip()) - - if (dpi_result_pps > 100): - dpi_result_pps = dpi_result_pps / 1000 - - if (dpi_result_bps > 100): - dpi_result_bps = dpi_result_bps / 1000 - - sum_dpi_pps += dpi_result_pps - sum_dpi_bps += dpi_result_bps - -dpi_result_pps = sum_dpi_pps / 10 -dpi_result_bps = sum_dpi_bps / 10 - -host = os.popen("hostname").read().rstrip() -log_time_stamp = str(datetime.datetime.utcnow().isoformat()) - -os.popen( - "cat $HOME/qtip_result/dpi_dump.txt > $HOME/qtip_result/" + - host + - "-" + - log_time_stamp + - ".log") - -home_dir = str(os.popen("echo $HOME").read().rstrip()) -host = os.popen("echo $HOSTNAME") -result = {'pps': round(dpi_result_pps, 3), - 'bps': round(dpi_result_bps, 3)} -with open('./result_temp', 'w+') as result_file: - pickle.dump(result, result_file) diff --git a/legacy/utils/transform/final_report.py b/legacy/utils/transform/final_report.py deleted file mode 100644 index 1d7c3001..00000000 --- a/legacy/utils/transform/final_report.py +++ /dev/null @@ -1,32 +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 pickle -import json -import datetime -import os -import sys - -home_dir = str((os.popen("echo $HOME").read().rstrip())) - -with open('./sys_info_temp', 'r') as sys_info_f: - sys_info_dict = pickle.load(sys_info_f) -with open('./result_temp', 'r') as result_f: - result_dict = pickle.load(result_f) - -host_name = (os.popen("hostname").read().rstrip()) -benchmark_name = str(sys.argv[1]) -testcase_name = str(sys.argv[2]) -report_time_stamp = str(datetime.datetime.utcnow().isoformat()) -final_dict = {"name": testcase_name, - "time": report_time_stamp, - "system_information": sys_info_dict, - "details": result_dict} - -with open('./' + host_name + '-' + report_time_stamp + '.json', 'w+') as result_json: - json.dump(final_dict, result_json, indent=4, sort_keys=True) diff --git a/legacy/utils/transform/fio_transform.py b/legacy/utils/transform/fio_transform.py deleted file mode 100644 index e8de2f9a..00000000 --- a/legacy/utils/transform/fio_transform.py +++ /dev/null @@ -1,37 +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 pickle -import os -import datetime - - -def get_fio_job_result(fio_job_data): - return {'read': {'io_bytes': fio_job_data["read"]["io_bytes"], - 'io_ps': fio_job_data["read"]["iops"], - 'io_runtime_millisec': fio_job_data["read"]["runtime"], - 'mean_io_latenchy_microsec': fio_job_data["read"]["lat"]["mean"]}, - 'write': {'io_bytes': fio_job_data["write"]["io_bytes"], - 'io_ps': fio_job_data["write"]["iops"], - 'io_runtime_millisec': fio_job_data["write"]["runtime"], - 'mean_io_latenchy_microsec': fio_job_data["write"]["lat"]["mean"]}} - - -with open("fio_result.json") as fio_raw: - fio_data = json.load(fio_raw) - -fio_result_dict = {} -for x, result in enumerate(map(get_fio_job_result, fio_data["jobs"])): - fio_result_dict['job_{0}'.format(x)] = result - -host_name = (os.popen("hostname").read().rstrip()) -report_time = str(datetime.datetime.utcnow().isoformat()) -os.system("mv fio_result.json " + str(host_name) + "-" + report_time + ".log") -with open('./result_temp', 'w + ')as out_fio_result: - pickle.dump(fio_result_dict, out_fio_result) 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)
diff --git a/legacy/utils/transform/ramspeed_transform.py b/legacy/utils/transform/ramspeed_transform.py deleted file mode 100644 index 9aa713ff..00000000 --- a/legacy/utils/transform/ramspeed_transform.py +++ /dev/null @@ -1,49 +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 os -import pickle -import datetime - -intmem_copy = os.popen("cat Intmem | grep 'BatchRun Copy' | awk '{print $4}'").read().rstrip() -intmem_scale = os.popen("cat Intmem | grep 'BatchRun Scale' | awk '{print $4}'").read().rstrip() -intmem_add = os.popen("cat Intmem | grep 'BatchRun Add' | awk '{print $4}'").read().rstrip() -intmem_triad = os.popen("cat Intmem | grep 'BatchRun Triad' | awk '{print $4}'").read().rstrip() -intmem_average = os.popen("cat Intmem | grep 'BatchRun AVERAGE' | awk '{print $4}'").read().rstrip() - -print intmem_copy -print intmem_average - -floatmem_copy = os.popen("cat Floatmem | grep 'BatchRun Copy' | awk '{print $4}'").read().rstrip() -floatmem_scale = os.popen("cat Floatmem | grep 'BatchRun Scale' | awk '{print $4}'").read().rstrip() -floatmem_add = os.popen("cat Floatmem | grep 'BatchRun Add' | awk '{print $4}'").read().rstrip() -floatmem_triad = os.popen("cat Floatmem | grep 'BatchRun Triad' | awk '{print $4}'").read().rstrip() -floatmem_average = os.popen("cat Floatmem | grep 'BatchRun AVERAGE' | awk '{print $4}'").read().rstrip() - -print floatmem_copy -print floatmem_average - -hostname = os.popen("hostname").read().rstrip() -time_stamp = str(datetime.datetime.utcnow().isoformat()) - -os.system("mv Intmem " + hostname + "-" + time_stamp + ".log") -os.system("cp Floatmem >> " + hostname + "-" + time_stamp + ".log") - -result = {"int_bandwidth": {"copy": intmem_copy, - "add": intmem_add, - "scale": intmem_scale, - "triad": intmem_triad, - "average": intmem_average}, - "float_bandwidth": {"copy": floatmem_copy, - "add": floatmem_add, - "scale": floatmem_scale, - "triad": floatmem_triad, - "average": floatmem_average}} - -with open('./result_temp', 'w+') as result_file: - pickle.dump(result, result_file) diff --git a/legacy/utils/transform/ssl_transform.py b/legacy/utils/transform/ssl_transform.py deleted file mode 100644 index 24b696e5..00000000 --- a/legacy/utils/transform/ssl_transform.py +++ /dev/null @@ -1,62 +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 os -import pickle -import datetime - -openssl_version = os.popen("cat RSA_dump | head -1").read().rstrip() -rsa_512_sps = os.popen( - "cat RSA_dump | grep '512 bits ' | awk '{print $6}' ").read().rstrip() -rsa_512_vps = os.popen( - "cat RSA_dump | grep '512 bits ' | awk '{print $7}' ").read().rstrip() -rsa_1024_sps = os.popen( - "cat RSA_dump | grep '1024 bits ' | awk '{print $6}' ").read().rstrip() -rsa_1024_vps = os.popen( - "cat RSA_dump | grep '1024 bits ' | awk '{print $7}' ").read().rstrip() -rsa_2048_sps = os.popen( - "cat RSA_dump | grep '2048 bits ' | awk '{print $6}' ").read().rstrip() -rsa_2048_vps = os.popen( - "cat RSA_dump | grep '2048 bits ' | awk '{print $7}' ").read().rstrip() -rsa_4096_sps = os.popen( - "cat RSA_dump | grep '4096 bits ' | awk '{print $6}' ").read().rstrip() -rsa_4096_vps = os.popen( - "cat RSA_dump | grep '4096 bits ' | awk '{print $7}' ").read().rstrip() - -aes_16B = os.popen( - "cat AES-128-CBC_dump | grep 'aes-128-cbc ' | awk '{print $2}' ").read().rstrip() -aes_64B = os.popen( - "cat AES-128-CBC_dump | grep 'aes-128-cbc ' | awk '{print $3}' ").read().rstrip() -aes_256B = os.popen( - "cat AES-128-CBC_dump | grep 'aes-128-cbc ' | awk '{print $4}' ").read().rstrip() -aes_1024B = os.popen( - "cat AES-128-CBC_dump | grep 'aes-128-cbc ' | awk '{print $5}' ").read().rstrip() -aes_8192B = os.popen( - "cat AES-128-CBC_dump | grep 'aes-128-cbc ' | awk '{print $6}' ").read().rstrip() - -hostname = os.popen("hostname").read().rstrip() -time_stamp = str(datetime.datetime.utcnow().isoformat()) - -os.system("mv RSA_dump " + hostname + "-" + time_stamp + ".log") -os.system("cat AES-128-CBC_dump >> " + hostname + "-" + time_stamp + ".log") - -result = {"version": [openssl_version], - "rsa_sig": {"512_bits": rsa_512_sps, - "1024_bits": rsa_1024_sps, - "2048_bits": rsa_2048_sps, - "4096_bits": rsa_4096_sps, - "unit": "sig/sec"}, - "aes_128_cbc": {"16B_block": aes_16B, - "64B_block": aes_64B, - "256B_block": aes_256B, - "1024B_block": aes_1024B, - "8192B_block": aes_8192B, - "unit": "B/sec"}} - -with open('./result_temp', 'w+') as result_file: - pickle.dump(result, result_file) diff --git a/legacy/utils/transform/ubench_transform.py b/legacy/utils/transform/ubench_transform.py deleted file mode 100644 index fe687118..00000000 --- a/legacy/utils/transform/ubench_transform.py +++ /dev/null @@ -1,40 +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 os -import json -import pickle - -total_cpu = os.popen( - "cat $HOME/tempT/UnixBench/results/* | grep 'of tests' | awk '{print $1;}' | awk 'NR==1'").read().rstrip() - -cpu_1 = os.popen( - "cat $HOME/tempT/UnixBench/results/* | grep 'of tests' | awk '{print $6;}' | awk 'NR==1'").read().rstrip() - - -cpu_2 = os.popen( - "cat $HOME/tempT/UnixBench/results/* | grep 'of tests' | awk '{print $6;}' | awk 'NR==2'").read().rstrip() - - -index_1 = os.popen( - "cat $HOME/tempT/UnixBench/results/* | grep 'Index Score (Partial Only) ' | awk '{print $7;}' | awk 'NR==1'").read().rstrip() -index_2 = os.popen( - "cat $HOME/tempT/UnixBench/results/* | grep 'Index Score (Partial Only) ' | awk '{print $7;}' | awk 'NR==2'").read().rstrip() - - -result = {"n_cpu": total_cpu, - "single": {"n_para_test": cpu_1, - "score": index_1}, - "multi": {"n_para_test": cpu_2, - "score": index_2} - } - -with open('result_temp', 'w+') as result_file: - pickle.dump(result, result_file) -print json.dumps(result, indent=4, sort_keys=True) -# print result.items() |