-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgather.py
54 lines (40 loc) · 1.36 KB
/
gather.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
import sys
def gather(fname):
fp = open(fname,"r")
mm = dict()
mm["tt_procesing"] = list()
mm["tuple_count"] = list()
mm["tt_init"] = list()
mm["tuples_per_second"] = list()
for line in fp.readlines():
if line.startswith("tt_procesing:"):
data = line.strip().split(":")
mm[data[0]].append(data[1])
if line.startswith("tuple_count:"):
data = line.strip().split(":")
mm[data[0]].append(data[1])
if line.startswith("tt_init:"):
data = line.strip().split(":")
mm[data[0]].append(data[1])
if line.startswith("tuples_per_second:"):
data = line.strip().split(":")
mm[data[0]].append(data[1])
fp.close()
return mm
if __name__ == "__main__":
if len(sys.argv) < 2:
print "Usage:",sys.argv[0],"<file>"
exit(1)
fname = sys.argv[1]
print "Process file: ", fname
mm = gather(fname)
# for measurement in mm:
# print measurement
# for v in mm[measurement]:
# print v
for i in range(len(mm["tt_init"])):
#print mm["tt_init"][i]
#print mm["tt_procesing"][i],mm["tuple_count"][i],mm["tt_init"][i]
#print mm["tuple_count"][i]
print mm["tuples_per_second"][i]
#print mm["tt_procesing"][i]