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:
robk-tahoe 2008-01-31 21:04:23 -07:00
parent e910a64e7d
commit b80cfeb186

View File

@ -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']