Step 1: Move vm scripts to the right place
[integration/test.git] / test / tools / odl-mdsal-clustering-tests / clustering-performance-test / create_plot_data_files.py
1 #!/usr/bin/python
2 import re
3
4 text_file = open("out.log.txt", "r")
5 log = text_file.read()
6 text_file.close()
7
8 data = []
9
10 pat = re.compile(r'Avg. requests/s: (?P<rate1>[0-9,\.]+) OK, (?P<rate2>[0-9,\.]+) Total')
11
12 for line in log.splitlines():
13     res = pat.search(line)
14     if res is not None:
15         data.append(res.groups('rate1')[0])
16 print data
17
18 text_file = open("rates.csv", "w")
19 text_file.write('Add,Delete\n')
20 text_file.write('{0},{1}\n'.format(data[0], data[1]))
21 text_file.close()