import numpy as np

file = "/home/rishabh/IdeaProjects/jitd/java/benchmark_20151213_224704_freqWrites/benchmark_scatter_1024m.txt"
# data = np.genfromtxt(file, dtype=(int, float, None), delimiter=',', names=['x', 'y', 'z'],)
data = np.genfromtxt(file, dtype=None, delimiter=',', names=['x', 'y', 'z'], )

write = 0
read = 0
max_read = 0
max_write = 0
read_count = 0
write_count = 0
total_time = 0
for each in data:
    if each[2] == 'WRITE':
        

    else:
        read += float(each[1])
        max_read = max(max_read, each[1])
        read_count += 1
        total_time += each[1]

print "average_write: " + str(write / write_count)
print "average_read: " + str(read / read_count)

print "max_write: " + str(max_write)
print "max_read: " + str(max_read)

print "total_time: " + str(total_time)

write += float(each[1])
        max_write = max(max_write, each[1])
        write_count += 1