Author: eallen
Date: 2009-04-23 16:33:39 -0400 (Thu, 23 Apr 2009)
New Revision: 3328
Modified:
mgmt/trunk/cumin/python/cumin/stat.py
Log:
Account for multiple samples with the same qmf_update_time for a statistic on the stacked
graphs.
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2009-04-23 18:22:49 UTC (rev 3327)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2009-04-23 20:33:39 UTC (rev 3328)
@@ -471,18 +471,22 @@
points = dict()
samples = dict()
+ collapsed = dict()
values = dict()
for stat in stats:
samples[stat] = stat.samples(object, duration)
+ # we sometimes get multiple samples for the same qmf_update_time
for sample in samples[stat]:
- t = sample[0]
+ collapsed[sample[0]] = sample[1]
+
+ for t in collapsed:
if not t in points:
points[t] = list()
values[t] = 0
- points[t].append(sample[1])
- values[t] = values[t] + sample[1]
- max_value = max(nvl(values[t], 0), max_value)
- min_value = min(nvl(values[t], 0), min_value)
+ points[t].append(collapsed[t])
+ values[t] = values[t] + collapsed[t]
+ max_value = max(values[t], max_value)
+ min_value = min(values[t], min_value)
max_value = round(max_value * 1.1 + 1)