Author: eallen
Date: 2010-09-02 10:59:17 -0400 (Thu, 02 Sep 2010)
New Revision: 4250
Modified:
mgmt/newdata/cumin/python/cumin/stat.py
Log:
Fix for BZ 628735: Fix code that creates deviated values from raw values.
Modified: mgmt/newdata/cumin/python/cumin/stat.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/stat.py 2010-09-01 19:06:10 UTC (rev 4249)
+++ mgmt/newdata/cumin/python/cumin/stat.py 2010-09-02 14:59:17 UTC (rev 4250)
@@ -391,9 +391,14 @@
samples[stat] = adapter.samples(stat, duration, interval, method)
# take stddev into account for max and min y values
- deviated_values = [(nvl(x[1],0) + float(nvl(x[2],0))/2,
- nvl(x[1],0) - float(nvl(x[2],0))/2)
- for x in samples[stat] for stat in stats]
+ deviated_values = list()
+ for stat in stats:
+ for x in samples[stat]:
+ d1 = nvl(x[1], 0)
+ d2 = nvl(x[2], 0) / 2
+ dv = (d1 + d2, d1 - d2)
+ deviated_values.append(dv)
+
max_value = deviated_values and max(max(deviated_values)) or 1
min_value = deviated_values and min(min(deviated_values)) or 0
Show replies by date