X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=blobdiff_plain;f=web%2FMonitorWeb%2Fmonitorweb%2Ftemplates%2Fnodefast.kid;fp=web%2FMonitorWeb%2Fmonitorweb%2Ftemplates%2Fnodefast.kid;h=2052b85c43dbeae12768fb4c84f8218fd6a12b8a;hp=253dc2f6dcf79efe18975e2336dfd501d728d38c;hb=09a4319e30f5fadf17cbc5fbbef03bb2a35c5f0f;hpb=fbe2fbd7f5d866205f878e68968dcef14a3812ab diff --git a/web/MonitorWeb/monitorweb/templates/nodefast.kid b/web/MonitorWeb/monitorweb/templates/nodefast.kid index 253dc2f..2052b85 100644 --- a/web/MonitorWeb/monitorweb/templates/nodefast.kid +++ b/web/MonitorWeb/monitorweb/templates/nodefast.kid @@ -5,6 +5,15 @@ from monitor.util import diff_time from time import mktime from links import * +def up_label (query): + up=len([agg for agg in query if agg.node.status in ('online', 'good')]) + total=len(query) + return "%d (%d %%)" %(up,100*up/total) +def down_label (query): + down=len([agg for agg in query if agg.node.status not in ('online', 'good')]) + total=len(query) + return "%d (%d %%)" %(down,100*down/total) + ?>
- | -
+ | +