Author: eallen
Date: 2009-07-13 15:58:14 -0400 (Mon, 13 Jul 2009)
New Revision: 3490
Modified:
mgmt/trunk/cumin/python/cumin/stat.py
mgmt/trunk/cumin/python/cumin/stat.strings
Log:
For performance use averaging on control chart for rates.
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2009-07-13 17:35:24 UTC (rev 3489)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2009-07-13 19:58:14 UTC (rev 3490)
@@ -761,6 +761,11 @@
return True
return False
+ def fix_method(self, method, mode):
+ if mode == "rate":
+ return None
+ return method
+
def create(self, session, object, stats):
# get the page parameters
width = self.page.container_width.get(session)
@@ -776,7 +781,10 @@
interval = self.page.get_interval(session, duration, width)
# get the most recent samples
- samples = self.fetch_samples(object, duration, interval, method, mode, delta,
stats, end_seconds_ago=end_seconds_ago)
+ samples = self.fetch_samples(object, duration, interval,
+ self.fix_method(method, mode),
+ mode, delta, stats,
+ end_seconds_ago=end_seconds_ago)
max_value, min_value = self.get_max_min(session, stats, samples)
append = False
@@ -788,7 +796,10 @@
max_of_axiis = max(max_value, axis_for_vals)
# the most recent value(s) changed the y-axis range
if axis_max != max_of_axiis:
- samples = self.fetch_samples(object, time_span, interval, method, mode,
False, stats, end_seconds_ago=end_seconds_ago)
+ samples = self.fetch_samples(object, time_span, interval,
+ self.fix_method(method, mode),
+ mode, False, stats,
+ end_seconds_ago=end_seconds_ago)
max_value, min_value = self.get_max_min(session, stats, samples)
else:
append = True
@@ -798,9 +809,6 @@
#print "**********\n"+chart.create()
return chart.create()
- def get_chart(self, session, object, stats, samples, duration, max_value, min_value,
append, end_secs):
- return Chart()
-
def get_y_labels(self, absy, intervals, step):
y_step = absy / intervals
labels = list()
@@ -853,6 +861,15 @@
return y_axis, y_axis_right
+ def fetch_samples(self, object, dur, interval, method, mode, delta, stats,
end_seconds_ago=0):
+ return dict()
+
+ def get_max_min(self, session, stats, samples):
+ return 0, 0
+
+ def get_chart(self, session, object, stats, samples, duration, max_value, min_value,
append, end_secs):
+ return Chart()
+
class AreaChart(FlashChart):
def __init__(self, app, name, page):
super(AreaChart, self).__init__(app, name, page)
@@ -862,7 +879,6 @@
def fetch_samples(self, object, dur, interval, method, mode, delta, stats,
end_seconds_ago=0):
samples = dict()
if mode == "rate":
- method = None # don't do averaging
for stat in stats:
os = stat.samples(object, dur, interval, method, secs2=end_seconds_ago)
ns = list()
Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings 2009-07-13 17:35:24 UTC (rev 3489)
+++ mgmt/trunk/cumin/python/cumin/stat.strings 2009-07-13 19:58:14 UTC (rev 3490)
@@ -251,7 +251,7 @@
var flashversion = swfobject.getFlashPlayerVersion();
if (flashversion.major < 9) {
wooly.addPageUpdateListener(function () {if
(document.images["{id}"].className == "Loading") return;
cumin.updateChart("{id}");});
- cumin.setupChart('{id}', '{fullpage_href}');
+ cumin.setupChart('{id}', {width});
} else {
swfobject.embedSWF("resource?name=open-flash-chart.swf",
"{id}_chart", "{width}", "{height}", "9.0.0",
"",
{"data-file":"{href}"});