Skip to content

Commit ff7e503

Browse files
committed
ensure descriptors is defined globally
descriptors is used globally and should be initialized globally as well
1 parent 57767be commit ff7e503

6 files changed

Lines changed: 13 additions & 6 deletions

File tree

diskstat/python_modules/diskstat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
import traceback
4242
import logging
4343

44+
descriptors = []
45+
4446
logging.basicConfig(level=logging.ERROR, format="%(asctime)s - %(name)s - %(levelname)s\t Thread-%(thread)d - %(message)s", filename='/tmp/gmond.log', filemode='w')
4547
logging.debug('starting up')
4648

@@ -280,7 +282,6 @@ def metric_init(params):
280282

281283
update_stats()
282284

283-
descriptors = []
284285
for label in descriptions:
285286
for dev in PARTITIONS:
286287
if stats[dev].has_key(label):

ehcache/python_modules/ehcache.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import tempfile
2121
import logging
2222

23+
descriptors = []
24+
2325
logging.basicConfig(level=logging.ERROR, format="%(asctime)s - %(name)s - %(levelname)s\t Thread-%(thread)d - %(message)s", filename='/tmp/gmond.log', filemode='w')
2426
#logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s\t Thread-%(thread)d - %(message)s", filename='/tmp/gmond.log2')
2527
logging.debug('starting up')
@@ -147,7 +149,6 @@ def metric_init(params):
147149
descriptions[name] = {}
148150

149151
time_max = 60
150-
descriptors = []
151152
for label in descriptions:
152153
if stats.has_key(label):
153154

httpd/python_modules/httpd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
import sys, re
4343
import logging
4444

45+
descriptors = []
46+
4547
logging.basicConfig(level=logging.ERROR, format="%(asctime)s - %(name)s - %(levelname)s\t Thread-%(thread)d - %(message)s", filename='/tmp/gmond.log', filemode='w')
4648
logging.debug('starting up')
4749

@@ -361,7 +363,6 @@ def metric_init(params):
361363
update_stats()
362364
update_server_stats()
363365

364-
descriptors = []
365366
for label in descriptions:
366367
if httpd_stats.has_key(label):
367368
d = {

jmxsh/python_modules/jmxsh.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
import tempfile
3939
import logging
4040

41+
descriptors = []
42+
4143
logging.basicConfig(level=logging.ERROR, format="%(asctime)s - %(name)s - %(levelname)s\t Thread-%(thread)d - %(message)s", filename='/tmp/gmond.log', filemode='w')
4244
#logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s\t Thread-%(thread)d - %(message)s", filename='/tmp/gmond.log2')
4345
logging.debug('starting up')
@@ -240,7 +242,6 @@ def metric_init(params):
240242
}
241243

242244
time_max = 60
243-
descriptors = []
244245
for label in descriptions:
245246
if stats.has_key(label):
246247

mysqld/python_modules/mysql.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
from DBUtil import parse_innodb_status
4646

4747
import logging
48+
49+
descriptors = []
50+
4851
logging.basicConfig(level=logging.ERROR, format="%(asctime)s - %(name)s - %(levelname)s\t Thread-%(thread)d - %(message)s", filename='/tmp/gmond.log', filemode='w')
4952
logging.debug('starting up')
5053

@@ -990,7 +993,6 @@ def metric_init(params):
990993
},
991994
)
992995

993-
descriptors = []
994996
update_stats(REPORT_INNODB, REPORT_MASTER, REPORT_SLAVE)
995997

996998
time.sleep(MAX_UPDATE_TIME)

procstat/python_modules/procstat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
import glob
106106
import logging
107107

108+
descriptors = []
109+
108110
logging.basicConfig(level=logging.ERROR, format="%(asctime)s - %(name)s - %(levelname)s\t Thread-%(thread)d - %(message)s", filename='/tmp/gmond.log', filemode='w')
109111
logging.debug('starting up')
110112

@@ -372,7 +374,6 @@ def metric_init(params):
372374
)
373375

374376
time_max = 60
375-
descriptors = []
376377
for label in descriptions:
377378
for proc in PROCESSES:
378379
if stats[proc].has_key(label):

0 commit comments

Comments
 (0)