diff options
Diffstat (limited to 'legacy/utils/transform')
-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/ramspeed_transform.py | 49 | ||||
-rw-r--r-- | legacy/utils/transform/ssl_transform.py | 62 | ||||
-rw-r--r-- | legacy/utils/transform/ubench_transform.py | 40 |
5 files changed, 0 insertions, 238 deletions
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/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() |