r69279 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69278‎ | r69279 | r69280 >
Date:01:30, 12 July 2010
Author:tstarling
Status:deferred
Tags:
Comment:
Fixes to r69278 following package testing:
* Don't use global conf in MySQLStats, pass parameter instead
* Added new file to Makefile
Modified paths:
  • /trunk/ganglia_metrics/Makefile (modified) (history)
  • /trunk/ganglia_metrics/MySQLStats.py (modified) (history)
  • /trunk/ganglia_metrics/gmetricd.py (modified) (history)

Diff [purge]

Index: trunk/ganglia_metrics/gmetricd.py
@@ -180,7 +180,7 @@
181181 diskStats = DiskStats.DiskStats()
182182 pushMetrics = GangliaMetrics.MetricCollection()
183183
184 -mysqlStats = MySQLStats.MySQLStats( conf['dbuser'], conf['dbpassword'] )
 184+mysqlStats = MySQLStats.MySQLStats( conf['dbuser'], conf['dbpassword'], conf['mysqlclient'] )
185185 allMetrics = (diskStats, pushMetrics, mysqlStats)
186186
187187 # Daemonize
Index: trunk/ganglia_metrics/MySQLStats.py
@@ -6,7 +6,7 @@
77 A collection of metrics from MySQL, using SHOW STATUS and SHOW PROCESSLIST
88 """
99 class MySQLStats(MetricCollection):
10 - def __init__(self, user, password):
 10+ def __init__(self, user, password, client):
1111 self.metrics = {
1212 'mysql_questions': DeltaMetricItem(
1313 'mysql_questions',
@@ -35,6 +35,7 @@
3636 }
3737 self.user = user
3838 self.password = password
 39+ self.client = client
3940
4041 if self.query('select 1') == None:
4142 self.disabled = True
@@ -76,10 +77,9 @@
7778 return True
7879
7980 def query(self, sql):
80 - global conf
8181 proc = subprocess.Popen(
8282 [
83 - conf['mysqlclient'], '-XB',
 83+ self.client, '-XB',
8484 '--user=' + self.user,
8585 '--password=' + self.password,
8686 '-e', sql
Index: trunk/ganglia_metrics/Makefile
@@ -1,5 +1,5 @@
2 -SOURCES=__init__.py gmetricd.py GangliaMetrics.py MySQLStats.py SelectServer.py
3 -OBJECTS=gmetricd.pyo GangliaMetrics.pyo MySQLStats.pyo SelectServer.pyo
 2+SOURCES=__init__.py gmetricd.py GangliaMetrics.py MySQLStats.py SelectServer.py DiskStats.py
 3+OBJECTS=gmetricd.pyo GangliaMetrics.pyo MySQLStats.pyo SelectServer.pyo DiskStats.pyo
44
55 all: $(OBJECTS)
66

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r69278* Fixed MySQL metrics, were completely untested and broken....tstarling01:15, 12 July 2010

Status & tagging log