[rhmessaging-commits] rhmessaging commits: r3398 - mgmt/trunk/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Thu May 28 11:33:19 EDT 2009


Author: eallen
Date: 2009-05-28 11:33:19 -0400 (Thu, 28 May 2009)
New Revision: 3398

Modified:
   mgmt/trunk/cumin/python/cumin/stat.py
Log:
Take stddev into account for max and min y values

Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py	2009-05-28 15:32:40 UTC (rev 3397)
+++ mgmt/trunk/cumin/python/cumin/stat.py	2009-05-28 15:33:19 UTC (rev 3398)
@@ -443,7 +443,7 @@
             method = self.method.get(session)
             for stat in stats:
                 samples[stat] = stat.samples(object, duration, interval, method)
-
+        """
         for stat in stats:
             values[stat] = [x[1] for x in samples[stat]]
 
@@ -460,7 +460,20 @@
 
         if min_value < 0:
             min_value = round(min_value * 1.1 - 1)
+        """
+        
+        # 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]
+        max_value = max(max(deviated_values))
+        min_value = min(min(deviated_values))
 
+        max_value = round(max_value * 1.1 + 1)
+
+        if min_value < 0:
+            min_value = round(min_value * 1.1 - 1)
+
         chart.x_max = duration
         chart.x_min = 0
         chart.y_max = max_value
@@ -495,8 +508,8 @@
             titles = ["%s / sec" % x.title for x in stats]
         else:
             titles = [x.title for x in stats]
+
             stds = [x[2] for x in samples[stat] if x[2] is not None and int(x[2]) is not 0 for stat in stats]
-
             if len(stds):
                 clrs = list(colors)
                 clrs[len(titles)] = (0,0,0)




More information about the rhmessaging-commits mailing list