9 size = struct.calcsize(DATAPOINT)
12 i = struct.unpack(DATAPOINT, d)
17 if __name__ == '__main__':
18 blocksize = int(sys.argv[1])
20 for f in sys.argv[2:]:
21 data += load_log(open(f))
24 duration = data[-1][0] - data[0][0]
25 #print "Time span: %d to %d (%d seconds)" % (data[0][0], data[-1][0], duration)
27 start = data[0][0] + 5
29 truncated = [d for d in data if start <= d[0] <= end]
30 #print len(data), len(truncated)
31 duration = float(end - start + 1)
33 #print "# ops/sec\tbandwidth (MB/s)\tLatency(ms)"
34 print "%s\t%s\t%s" % (len(truncated) / duration,
35 len(truncated) / duration * blocksize / 1024.0**2,
36 sum(d[1] for d in truncated) / len(truncated) / 1000)