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

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Wed Oct 20 14:10:28 EDT 2010


Author: eallen
Date: 2010-10-20 14:10:28 -0400 (Wed, 20 Oct 2010)
New Revision: 4398

Modified:
   mgmt/trunk/cumin/python/cumin/stat.py
Log:
Use calculated max and min values for percentage charts instead of 0 and 100

Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py	2010-10-20 17:28:20 UTC (rev 4397)
+++ mgmt/trunk/cumin/python/cumin/stat.py	2010-10-20 18:10:28 UTC (rev 4398)
@@ -1201,8 +1201,17 @@
 
 class PercentAreaChart(AreaChart):
     def get_max_min(self, session, stats, samples):
-        return 100.0, 0.0
+        max_val, min_val = super(PercentAreaChart, self).get_max_min(session, stats, samples)
 
+        percent = self.page.percent_property.get(session)
+        total = self.page.get_object_property(session, percent)
+        total = total and float(total) or 1.0
+
+        max_val = (max_val / total) * 100.0
+        min_val = (min_val / total) * 100.0
+
+        return max_val, min_val
+
     def get_vals(self, session, samples, stat, text, duration, end_secs):
         tnow = time()
         vals = list()



More information about the rhmessaging-commits mailing list