blob: f15943d71ebca2b88c12d69d3e97a226e252b0b7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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()
|