4 text_file = open("out.log.txt", "r")
11 pat_rate = re.compile(
12 r"Avg. requests/s: (?P<rate1>[0-9,\.]+) OK, (?P<rate2>[0-9,\.]+) Total"
14 pat_time = re.compile(r"Stats collected in (?P<time1>[0-9,\.]+) seconds")
16 for line in log.splitlines():
17 res = pat_rate.search(line)
19 rate.append(res.groups("rate1")[0])
22 for line in log.splitlines():
23 res = pat_time.search(line)
25 time.append(res.groups("time1")[0])
28 text_file = open("rates.csv", "w")
29 text_file.write("Add,Delete\n")
30 text_file.write("{0},{1}\n".format(rate[0], rate[1]))
33 text_file = open("times.csv", "w")
34 text_file.write("Add,Delete\n")
35 text_file.write("{0},{1}\n".format(time[0], time[1]))