mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 07:06:41 +00:00
munin stats: suppress output of data more that 5min old
if a node fails to report stats, the natural thing to do in re munin is to supress the data for that data series. the previous tahoe-stats would output whatever data was present in the stats_gatherer's stats.pickle, regardless of how old. this change means that if the gatherer hasn't received data within the last 5 min, then no data is reported to munin for that node.
This commit is contained in:
parent
e910a64e7d
commit
b80cfeb186
@ -4,6 +4,9 @@ import os
|
||||
import pickle
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
|
||||
STAT_VALIDITY = 300 # 5min limit on reporting stats
|
||||
|
||||
PLUGINS = {
|
||||
'tahoe_storage_consumed':
|
||||
@ -122,8 +125,11 @@ def main(argv):
|
||||
|
||||
stats = open_stats(stats_file)
|
||||
|
||||
now = time.time()
|
||||
def output_nodes(output_section):
|
||||
for tubid, nodestats in stats.items():
|
||||
if (now - nodestats.get('timestamp', 0)) > STAT_VALIDITY:
|
||||
continue
|
||||
name = smash_name("%s_%s" % (nodestats['nickname'], tubid[:4]))
|
||||
#value = nodestats['stats'][plugin_conf['category']].get(plugin_conf['statid'])
|
||||
category = plugin_conf['category']
|
||||
|
Loading…
Reference in New Issue
Block a user