Skip to content

Commit

Permalink
allow for gmetric compatible type
Browse files Browse the repository at this point in the history
the "uint" type is not valid for gmetric, which requires the bit specific
width specified explicitally (8, 16 or 32).

transform the type into a 32bit unsigned int if using uint
and which is the equivalent used internally in modpython.
  • Loading branch information
carenas committed Mar 14, 2011
1 parent 85ecf0a commit 57767be
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 6 deletions.
7 changes: 6 additions & 1 deletion diskstat/python_modules/diskstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,12 @@ def metric_cleanup():
print ' %s: %s %s [%s]' % (d['name'], v, d['units'], d['description'])

if options.gmetric:
if d['value_type'] == 'uint':
value_type = 'uint32'
else:
value_type = d['value_type']

cmd = "%s --conf=%s --value='%s' --units='%s' --type='%s' --name='%s' --slope='%s'" % \
(options.gmetric_bin, options.gmond_conf, v, d['units'], d['value_type'], d['name'], d['slope'])
(options.gmetric_bin, options.gmond_conf, v, d['units'], value_type, d['name'], d['slope'])
os.system(cmd)

7 changes: 6 additions & 1 deletion ehcache/python_modules/ehcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,12 @@ def metric_cleanup():
print ' %s: %s %s [%s]' % (d['name'], d['format'] % v, d['units'], d['description'])

if options.gmetric:
if d['value_type'] == 'uint':
value_type = 'uint32'
else:
value_type = d['value_type']

cmd = "%s --conf=%s --value='%s' --units='%s' --type='%s' --name='%s' --slope='%s'" % \
(options.gmetric_bin, options.gmond_conf, v, d['units'], d['value_type'], d['name'], d['slope'])
(options.gmetric_bin, options.gmond_conf, v, d['units'], value_type, d['name'], d['slope'])
os.system(cmd)

7 changes: 6 additions & 1 deletion httpd/python_modules/httpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,12 @@ def metric_cleanup():
print ' %s: %s %s [%s]' % (d['name'], v, d['units'], d['description'])

if options.gmetric:
if d['value_type'] == 'uint':
value_type = 'uint32'
else:
value_type = d['value_type']

cmd = "%s --conf=%s --value='%s' --units='%s' --type='%s' --name='%s' --slope='%s'" % \
(options.gmetric_bin, options.gmond_conf, v, d['units'], d['value_type'], d['name'], d['slope'])
(options.gmetric_bin, options.gmond_conf, v, d['units'], value_type, d['name'], d['slope'])
os.system(cmd)

7 changes: 6 additions & 1 deletion jmxsh/python_modules/jmxsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,12 @@ def metric_cleanup():
print ' %s: %s %s [%s]' % (d['name'], d['format'] % v, d['units'], d['description'])

if options.gmetric:
if d['value_type'] == 'uint':
value_type = 'uint32'
else:
value_type = d['value_type']

cmd = "%s --conf=%s --value='%s' --units='%s' --type='%s' --name='%s' --slope='%s'" % \
(options.gmetric_bin, options.gmond_conf, v, d['units'], d['value_type'], d['name'], d['slope'])
(options.gmetric_bin, options.gmond_conf, v, d['units'], value_type, d['name'], d['slope'])
os.system(cmd)

7 changes: 6 additions & 1 deletion mysqld/python_modules/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,12 @@ def metric_cleanup():
print ' %s: %s %s [%s]' % (d['name'], v, d['units'], d['description'])

if options.gmetric:
if d['value_type'] == 'uint':
value_type = 'uint32'
else:
value_type = d['value_type']

cmd = "%s --conf=%s --value='%s' --units='%s' --type='%s' --name='%s' --slope='%s'" % \
(options.gmetric_bin, options.gmond_conf, v, d['units'], d['value_type'], d['name'], d['slope'])
(options.gmetric_bin, options.gmond_conf, v, d['units'], value_type, d['name'], d['slope'])
os.system(cmd)

7 changes: 6 additions & 1 deletion procstat/python_modules/procstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,13 @@ def metric_cleanup():
print ' %s: %s %s [%s]' % (d['name'], d['format'] % v, d['units'], d['description'])

if options.gmetric:
if d['value_type'] == 'uint':
value_type = 'uint32'
else:
value_type = d['value_type']

cmd = "%s --conf=%s --value='%s' --units='%s' --type='%s' --name='%s' --slope='%s'" % \
(options.gmetric_bin, options.gmond_conf, v, d['units'], d['value_type'], d['name'], d['slope'])
(options.gmetric_bin, options.gmond_conf, v, d['units'], value_type, d['name'], d['slope'])
os.system(cmd)


0 comments on commit 57767be

Please sign in to comment.