Add some new fedmsg health bits to graph in collectd.
This commit is contained in:
parent
c13973a1c1
commit
265bbfb1c0
1 changed files with 31 additions and 0 deletions
|
@ -49,6 +49,37 @@ def print_consumer(service, consumer):
|
|||
consumer['headcount_out']
|
||||
)
|
||||
|
||||
# And these got introduced even later
|
||||
if 'times' in consumer:
|
||||
maxval = max(consumer['times'] or [0])
|
||||
minval = min(consumer['times'] or [0])
|
||||
|
||||
avgval = 0
|
||||
if consumer['times']:
|
||||
avgval = sum(consumer['times']) / len(consumer['times'])
|
||||
|
||||
print "PUTVAL %s/%s/response_time-%s interval=5 %i:%i" % (
|
||||
hostname,
|
||||
service,
|
||||
'%s_min' % consumer['name'],
|
||||
timestamp,
|
||||
minval,
|
||||
)
|
||||
print "PUTVAL %s/%s/response_time-%s interval=5 %i:%i" % (
|
||||
hostname,
|
||||
service,
|
||||
'%s_max' % consumer['name'],
|
||||
timestamp,
|
||||
maxval,
|
||||
)
|
||||
print "PUTVAL %s/%s/response_time-%s interval=5 %i:%i" % (
|
||||
hostname,
|
||||
service,
|
||||
'%s_avg' % consumer['name'],
|
||||
timestamp,
|
||||
avgval,
|
||||
)
|
||||
|
||||
|
||||
def print_producer(service, producer):
|
||||
timestamp = int(time.time())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue