improve output of parse_buffer_log.py
This commit is contained in:
parent
4f1618a796
commit
1c7cf9a5c8
|
@ -9,11 +9,19 @@ lines = open(sys.argv[1], 'rb').readlines()
|
||||||
# example:
|
# example:
|
||||||
# 16434 read cache: 17
|
# 16434 read cache: 17
|
||||||
|
|
||||||
|
key_order = ['receive buffer', 'send buffer', 'write cache', 'read cache', 'hash temp']
|
||||||
|
colors = ['30f030', 'f03030', '80f080', 'f08080', '4040ff']
|
||||||
|
|
||||||
keys = []
|
keys = []
|
||||||
fields = {}
|
fields = {}
|
||||||
maximum = {}
|
maximum = {}
|
||||||
out = open('disk_buffer_log.dat', 'w+')
|
out = open('disk_buffer_log.dat', 'w+')
|
||||||
|
|
||||||
|
for c in key_order:
|
||||||
|
keys.append(c)
|
||||||
|
fields[c] = 0
|
||||||
|
maximum[c] = 0
|
||||||
|
|
||||||
last_t = 0
|
last_t = 0
|
||||||
for l in lines:
|
for l in lines:
|
||||||
try:
|
try:
|
||||||
|
@ -62,8 +70,8 @@ keys.reverse()
|
||||||
for k in keys:
|
for k in keys:
|
||||||
expr = "$%d" % count
|
expr = "$%d" % count
|
||||||
for i in xrange(2, count): expr += "+$%d" % i
|
for i in xrange(2, count): expr += "+$%d" % i
|
||||||
print >>out, ' "disk_buffer_log.dat" using 1:(%s) title "%s" with filledcurves x1,' % (expr, k),
|
|
||||||
count -= 1
|
count -= 1
|
||||||
|
print >>out, ' "disk_buffer_log.dat" using 1:(%s) title "%s" with filledcurves x1 lt rgb "#%s",' % (expr, k, colors[count-1]),
|
||||||
print >>out, 'x=0'
|
print >>out, 'x=0'
|
||||||
out.close()
|
out.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue