Commit 9ddca5f9 authored by Rich Prohaska's avatar Rich Prohaska

#68 simplify tokustat output

parent 2dadbbe4
...@@ -7,9 +7,12 @@ import MySQLdb ...@@ -7,9 +7,12 @@ import MySQLdb
def usage(): def usage():
print "diff the tokudb engine status" print "diff the tokudb engine status"
print "[--host=HOSTNAME] (default: localhost)" print "--host=HOSTNAME (default: localhost)"
print "[--port=PORT]" print "--port=PORT"
print "[--sleeptime=SLEEPTIME] (default: 10 seconds)" print "--sleeptime=SLEEPTIME (default: 10 seconds)"
print "--q='show engine tokudb status'"
print "--q='select * from information_schema.global_status'"
return 1 return 1
def convert(v): def convert(v):
...@@ -38,9 +41,14 @@ def printit(stats, rs, sleeptime): ...@@ -38,9 +41,14 @@ def printit(stats, rs, sleeptime):
print k, "|", oldv, "|", v, print k, "|", oldv, "|", v,
try: try:
d = v - oldv d = v - oldv
if d == 0: if sleeptime != 1:
d = float(v - oldv) if d >= sleeptime:
print "|", d, "|", d / sleeptime e = d / sleeptime
else:
e = float(d) / sleeptime
print "|", d, "|", e
else:
print "|", d
except: except:
print print
stats[k] = v stats[k] = v
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment