Skip to content

Commit

Permalink
Handle the output of "SHOW PROCESSLIST" from MySQL 5.5.
Browse files Browse the repository at this point in the history
New columns have been added in 5.5, just ignore them.

Change-Id: Ia71339f7fd7b212c771736dee00e4dd676107889
  • Loading branch information
tsuna committed Aug 17, 2011
1 parent 006cd9c commit 7142d7f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion collectors/0/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ def printmetric(metric, value, tags=""):
isyes(slave_status["slave_sql_running"]))

states = {} # maps a connection state to number of connections in that state
for id, user, host, db_, cmd, time, state, _ in db.query("SHOW PROCESSLIST"):
for row in db.query("SHOW PROCESSLIST"):
id, user, host, db_, cmd, time, state = row[:7]
states[cmd] = states.get(cmd, 0) + 1
for state, count in states.iteritems():
state = state.lower().replace(" ", "_")
Expand Down

0 comments on commit 7142d7f

Please sign in to comment.