2 from subprocess
import call
3 from collections
import defaultdict
10 df
['nsecperiter']=(df
['duration']*1000)/(df
['nbiter'])
11 stdev
= pd
.DataFrame({'perevent_stdev' :
12 df
.groupby(['nbthreads', 'tracer', 'testcase','sleeptime'])['nsecperiter'].std()}).reset_index()
13 mean
= pd
.DataFrame({'perevent_mean' :
14 df
.groupby(['nbthreads', 'tracer', 'testcase','sleeptime'])['nsecperiter'].mean()}).reset_index()
15 mem_mean
= pd
.DataFrame({'mem_mean' :
16 df
.groupby(['nbthreads','tracer','testcase','sleeptime'])['maxmem'].mean()}).reset_index()
17 mem_stdev
= pd
.DataFrame({'mem_stdev' :
18 df
.groupby(['nbthreads','tracer','testcase','sleeptime'])['maxmem'].std()}).reset_index()
19 tmp
= mean
.merge(stdev
)
20 tmp
= tmp
.merge(mem_mean
)
21 tmp
= tmp
.merge(mem_stdev
)
23 for i
, row
in tmp
.iterrows():
24 testcase_name
='_'.join([row
['tracer'],str(row
['nbthreads'])+'thr', 'pereventmean'])
25 yield( {"name": testcase_name
, "result": "pass", "units": "nsec/event",
26 "measurement": str(row
['perevent_mean'])})
28 testcase_name
='_'.join([row
['tracer'],str(row
['nbthreads'])+'thr', 'pereventstdev'])
29 yield( {"name": testcase_name
, "result": "pass", "units": "nsec/event",
30 "measurement": str(row
['perevent_stdev'])})
32 testcase_name
='_'.join([row
['tracer'],str(row
['nbthreads'])+'thr', 'memmean'])
33 yield( {"name": testcase_name
, "result": "pass", "units": "kB",
34 "measurement": str(row
['mem_mean'])})
36 testcase_name
='_'.join([row
['tracer'],str(row
['nbthreads'])+'thr', 'memstdev'])
37 yield( {"name": testcase_name
, "result": "pass", "units": "kB",
38 "measurement": str(row
['mem_stdev'])})
42 results_file
=sys
.argv
[1]
43 df
= pd
.read_csv(results_file
)
50 '--result', res
['result'],
51 '--measurement', res
['measurement'],
52 '--units', res
['units']])
54 # Save the results to write to the CSV file
55 if 'pereventmean' in res
['name']:
56 results
[res
['name']]=res
['measurement']
58 # Write the dictionnary to a csv file where each key is a column
59 with
open('processed_results.csv', 'w') as output_csv
:
60 dict_csv_write
=csv
.DictWriter(output_csv
, results
.keys())
61 dict_csv_write
.writeheader()
62 dict_csv_write
.writerow(results
)
64 if __name__
== '__main__':
This page took 0.032417 seconds and 5 git commands to generate.