-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstats.py
53 lines (43 loc) · 1.76 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/python
import numpy
data = numpy.loadtxt("block_log")
if data.size > 0:
print "block log"
print "mean {}".format(numpy.mean(data))
print "standard deviation {}".format(numpy.std(data))
data = numpy.loadtxt("version_log")
if data.size > 0:
print "version log"
print "mean {}".format(numpy.mean(data))
print "standard deviation {}".format(numpy.std(data))
data = numpy.loadtxt("reader_f_log")
if data.size > 0:
print "pread file reader"
print "mean {}".format(numpy.mean(data))
print "standard deviation {}".format(numpy.std(data))
print "count {}".format(data.size)
data = numpy.loadtxt("reader_m_log")
if data.size > 0:
print "mmap file reader"
print "mean {}".format(numpy.mean(data))
print "standard deviation {}".format(numpy.std(data))
print "count {}".format(data.size)
with open("reader_log") as logfile:
array_start = []
array_read = []
array_finish = []
for line in logfile:
line = line.split(" ")
if line[0] == "START":
array_start.append(line[1])
elif line[0] == "READ":
array_read.append(line[1])
elif line[0] == "FINISH":
array_finish.append(line[1])
print "block reader details"
print "start mean {}".format(numpy.mean(numpy.array(array_start).astype(numpy.int)))
print "read mean {}".format(numpy.mean(numpy.array(array_read).astype(numpy.int)))
print "finish mean {}".format(numpy.mean(numpy.array(array_finish).astype(numpy.int)))
print "start deviation {}".format(numpy.std(numpy.array(array_start).astype(numpy.int)))
print "read deviation {}".format(numpy.std(numpy.array(array_read).astype(numpy.int)))
print "finish deviation {}".format(numpy.std(numpy.array(array_finish).astype(numpy.int)))