forked from d7415/merlin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stats.py
30 lines (27 loc) · 1.09 KB
/
stats.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
# Simple statistics script for merlin
#
# Assumes that scan parsing logs are stored in "scanlog.txt" and excalibur logs in "dumplog.txt".
#
# Martin Stone
from numpy import mean, std, var
f=file("scanlog.txt","r")
a=[]
for l in f:
if l[:5] == "Total":
a.append(float(l.split()[3]))
print "Scan parsing times:"
print " Min: %5.3fs Max: %5.3fs Mean: %5.3fs Standard Deviation: %5.3fs Variance: %5.3fs Samples: %d" % (min(a), max(a), mean(a), std(a), var(a), len(a))
f.close()
f=file("dumplog.txt","r")
a=[]
b=[]
for l in f:
if l[:7] == "Total t":
a.append(float(l.split()[3]))
elif l[:6] == "Loaded":
b.append(float(l.split()[5]))
print "Dump loading times:"
print " Min: %5.3fs Max: %5.3fs Mean: %5.3fs Standard Deviation: %5.3fs Variance: %5.3fs Samples: %d" % (min(b), max(b), mean(b), std(b), var(b), len(b))
print "Total tick processing times:"
print " Min: %5.3fs Max: %5.3fs Mean: %5.3fs Standard Deviation: %5.3fs Variance: %5.3fs Samples: %d" % (min(a), max(a), mean(a), std(a), var(a), len(a))
f.close()