Skip to content

Commit

Permalink
Detect when the InnoDB engine is used.
Browse files Browse the repository at this point in the history
Change-Id: Id43513cef6af2d4a6e3b53ba6c48dc6894bd44fe
  • Loading branch information
tsuna committed Aug 21, 2011
1 parent c04bc2a commit 74bf765
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion collectors/0/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def collect(db):
def printmetric(metric, value, tags=""):
print "mysql.%s %d %s schema=%s%s" % (metric, ts, value, db.dbname, tags)

has_innodb = False
if db.isShowGlobalStatusSafe():
for metric, value in db.query("SHOW GLOBAL STATUS"):
try:
Expand All @@ -240,9 +241,10 @@ def printmetric(metric, value, tags=""):
except ValueError:
continue
metric = metric.lower()
has_innodb = has_innodb or metric.startswith("innodb")
printmetric(metric, value)

if False: # This is disabled because it's too expensive for InnoDB.
if has_innodb and False: # Disabled because it's too expensive for InnoDB.
waits = {} # maps a mutex name to the number of waits
for engine, mutex, status in db.query("SHOW ENGINE INNODB MUTEX"):
if not status.startswith("os_waits"):
Expand Down

0 comments on commit 74bf765

Please sign in to comment.