summaryrefslogtreecommitdiffstats
path: root/benchmarks/playbooks/result_transform
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/playbooks/result_transform')
-rw-r--r--benchmarks/playbooks/result_transform/dpi/dpi_average.sh14
-rw-r--r--benchmarks/playbooks/result_transform/dpi/dpi_transform.py50
-rw-r--r--benchmarks/playbooks/result_transform/final_report.py23
-rw-r--r--benchmarks/playbooks/result_transform/ssl/ssl_transform.py67
-rw-r--r--benchmarks/playbooks/result_transform/ubench_transform.py35
5 files changed, 189 insertions, 0 deletions
diff --git a/benchmarks/playbooks/result_transform/dpi/dpi_average.sh b/benchmarks/playbooks/result_transform/dpi/dpi_average.sh
new file mode 100644
index 00000000..405d3ff6
--- /dev/null
+++ b/benchmarks/playbooks/result_transform/dpi/dpi_average.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+COUNTER=0
+WDIR=$PWD
+while [ $COUNTER -lt 10 ]; do
+
+ echo $WDIR
+ $( ./ndpiReader -i test.pcap >> $WDIR/dpi_dump.txt )
+ let COUNTER=COUNTER+1
+ echo "Run number: $COUNTER"
+
+done
+
+
diff --git a/benchmarks/playbooks/result_transform/dpi/dpi_transform.py b/benchmarks/playbooks/result_transform/dpi/dpi_transform.py
new file mode 100644
index 00000000..89e4f187
--- /dev/null
+++ b/benchmarks/playbooks/result_transform/dpi/dpi_transform.py
@@ -0,0 +1,50 @@
+import os
+import json
+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 = {}
+result['DPI_benchmark(M pps)'] = round(dpi_result_pps, 3)
+result['DPI_benchmark(Gb/s)'] = round(dpi_result_bps, 3)
+with open('./result_temp', 'w+') as result_file:
+ pickle.dump(result, result_file)
+
diff --git a/benchmarks/playbooks/result_transform/final_report.py b/benchmarks/playbooks/result_transform/final_report.py
new file mode 100644
index 00000000..576109bf
--- /dev/null
+++ b/benchmarks/playbooks/result_transform/final_report.py
@@ -0,0 +1,23 @@
+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])
+report_time_stamp = str(datetime.datetime.utcnow().isoformat())
+final_dict = {}
+final_dict['1 Time of Report'] = report_time_stamp
+final_dict['2 System Information'] = sys_info_dict
+final_dict['3 ' + benchmark_name + ' result'] = 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/benchmarks/playbooks/result_transform/ssl/ssl_transform.py b/benchmarks/playbooks/result_transform/ssl/ssl_transform.py
new file mode 100644
index 00000000..188eb3d5
--- /dev/null
+++ b/benchmarks/playbooks/result_transform/ssl/ssl_transform.py
@@ -0,0 +1,67 @@
+import os
+import json
+import pickle
+import datetime
+
+#total_cpu=os.popen("cat $HOME/tempD/nDPI/example/result.txt | tail -1").read()
+
+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 = {}
+
+result['1. Version'] = [openssl_version]
+result['2. RSA singatures'] = {}
+result['2. RSA singatures']['1. 512 bits (sign/s)'] = [rsa_512_sps]
+result['2. RSA singatures']['2. 1024 bits (sign/s)'] = [rsa_1024_sps]
+result['2. RSA singatures']['3. 2048 bits (sign/s)'] = [rsa_2048_sps]
+result['2. RSA singatures']['4. 4096 bits (sign/s)'] = [rsa_4096_sps]
+
+result['3. AES-128-cbc throughput'] = {}
+result['3. AES-128-cbc throughput']['1. 16 Bytes block (B/sec)'] = [aes_16B]
+result['3. AES-128-cbc throughput']['2. 64 Bytes block (B/sec)'] = [aes_64B]
+result['3. AES-128-cbc throughput']['3. 256 Bytes block (B/sec)'] = [aes_256B]
+result['3. AES-128-cbc throughput']['4. 1024 Bytes block (B/sec)'] = [aes_1024B]
+result['3. AES-128-cbc throughput']['5. 16 Bytes block (B/sec)'] = [aes_8192B]
+
+
+with open('./result_temp', 'w+') as result_file:
+ pickle.dump(result, result_file)
+
+
diff --git a/benchmarks/playbooks/result_transform/ubench_transform.py b/benchmarks/playbooks/result_transform/ubench_transform.py
new file mode 100644
index 00000000..f15943d7
--- /dev/null
+++ b/benchmarks/playbooks/result_transform/ubench_transform.py
@@ -0,0 +1,35 @@
+import os
+import json
+import pickle
+import datetime
+
+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 = {}
+result['1.Number of CPU(s) in system'] = total_cpu
+result['2.Single CPU test'] = {}
+result['2.Single CPU test']['1.Number of parallell test(s)'] = cpu_1
+result['2.Single CPU test']['2.Index score'] = Index_1
+result['3.Multi CPU test'] = {}
+result['3.Multi CPU test']['1.Number of parallell test(s)'] = cpu_2
+result['3.Multi CPU test']['2.Index 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()