diff options
Diffstat (limited to 'data/ref_results/network_suite.py')
-rw-r--r-- | data/ref_results/network_suite.py | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/data/ref_results/network_suite.py b/data/ref_results/network_suite.py index 0e687f6a..fd756aa0 100644 --- a/data/ref_results/network_suite.py +++ b/data/ref_results/network_suite.py @@ -3,20 +3,32 @@ import network_benchmarks_indices as benchmark_indices network_dict={}; -network_dict['IPERF']=benchmark_indices.iperf_index() +try: + network_dict['IPERF']=benchmark_indices.iperf_index() +except: + pass network_bench_list=['IPERF'] temp=0 +l=len(network_bench_list) + for benchmark in network_bench_list: - temp=temp+float(network_dict[benchmark]['1. Index']) -network_suite_index=temp/len(network_bench_list) - -network_dict_f={}; -network_dict_f['1. Index']=network_suite_index -network_dict_f['2. Network suite results']=network_dict -with open('../../results/network_result.json', 'w+') as result_json: - json.dump(network_dict_f, result_json, indent=4, sort_keys=True) + try: + temp=temp+float(network_dict[benchmark]['1. Index']) + except: + l=l-1 + pass + +if l == 0: + print "No network results found" +else: + network_suite_index=temp/len(network_bench_list) + network_dict_f={}; + network_dict_f['index']=network_suite_index + network_dict_f['suite results']=network_dict + with open('../../results/network_result.json', 'w+') as result_json: + json.dump(network_dict_f, result_json, indent=4, sort_keys=True) |