[rhmessaging-commits] rhmessaging commits: r3399 - mgmt/trunk/cumin/python/cumin.
rhmessaging-commits at lists.jboss.org
rhmessaging-commits at lists.jboss.org
Thu May 28 11:41:37 EDT 2009
Author: eallen
Date: 2009-05-28 11:41:37 -0400 (Thu, 28 May 2009)
New Revision: 3399
Modified:
mgmt/trunk/cumin/python/cumin/stat.py
Log:
Handle case when there are no samples to graph
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2009-05-28 15:33:19 UTC (rev 3398)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2009-05-28 15:41:37 UTC (rev 3399)
@@ -466,8 +466,8 @@
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 = deviated_values and max(max(deviated_values)) or 1
+ min_value = deviated_values and min(min(deviated_values)) or 0
max_value = round(max_value * 1.1 + 1)
More information about the rhmessaging-commits
mailing list