-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess_results.py
65 lines (44 loc) · 1.15 KB
/
process_results.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import sys
import re
if len(sys.argv) != 2:
exit("Must provide filename")
filename = sys.argv[1]
file = open(filename)
globalCompletions = []
globalVisits = []
line = file.readline()
while True:
#print("Parsing line ", line)
if line == '':
break
match1 = re.search("EXEC", line)
if match1 != None:
line = file.readline()
continue
completions = []
visits = []
for measurement in range(5):
match2 = re.search("mcts_main", line)
if match2 == None:
print(line)
exit("Unexpected mismatch")
line = file.readline()
match3 = re.search("AVG Global completions/msec: (.*)", line)
if match3 == None:
print(line)
exit("Unexpected mismatch (completions)")
completions.append(match3.group(1).strip())
line = file.readline()
match4 = re.search("AVG Global visits/msec: (.*)", line)
if match4 == None:
print(line)
exit("Unexpected mismatch (visits)")
visits.append(match4.group(1).strip())
line = file.readline()
globalCompletions.append( ", ".join(completions) )
globalVisits.append( ", ".join(visits) )
file.close()
for completion in globalCompletions:
print(completion)
for visits in globalVisits:
print(visits)