munin stats: don't suppress series with no current data

having changed tahoe-stats to not report data series if there was no recent
data recorded for a node, I wound up making it hide the data series.  this
change causes it to report all data series for which stats exist in the
'config' phase, so that they show up, but only report actual data if the
stats are recent, so that they show up as missing if the node is not
reporting stats currently
This commit is contained in:
robk-tahoe 2008-02-01 18:44:57 -07:00
parent 67660232f1
commit 3641b7924b

View File

@ -126,9 +126,9 @@ def main(argv):
stats = open_stats(stats_file)
now = time.time()
def output_nodes(output_section):
def output_nodes(output_section, check_time):
for tubid, nodestats in stats.items():
if (now - nodestats.get('timestamp', 0)) > STAT_VALIDITY:
if check_time and (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'])
@ -142,10 +142,10 @@ def main(argv):
if len(argv) > 1:
if sys.argv[1] == 'config':
print plugin_conf['configheader']
output_nodes('graph_config')
output_nodes('graph_config', False)
sys.exit(0)
output_nodes('graph_render')
output_nodes('graph_render', True)
if __name__ == '__main__':
main(sys.argv)