rhmessaging commits: r3494 - mgmt/trunk/cumin/resources.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-13 18:02:35 -0400 (Mon, 13 Jul 2009)
New Revision: 3494
Modified:
mgmt/trunk/cumin/resources/open-flash-chart.swf
Log:
Move control chart's x-axis under the control chart.
Modified: mgmt/trunk/cumin/resources/open-flash-chart.swf
===================================================================
(Binary files differ)
15 years, 5 months
rhmessaging commits: r3493 - mgmt/trunk/cumin/resources.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-13 18:01:53 -0400 (Mon, 13 Jul 2009)
New Revision: 3493
Modified:
mgmt/trunk/cumin/resources/app.js
Log:
Fix problem with non-fullpage flash charts after one minute.
Modified: mgmt/trunk/cumin/resources/app.js
===================================================================
--- mgmt/trunk/cumin/resources/app.js 2009-07-13 22:01:15 UTC (rev 3492)
+++ mgmt/trunk/cumin/resources/app.js 2009-07-13 22:01:53 UTC (rev 3493)
@@ -395,9 +395,11 @@
}
var last_full_time = chart.last_full_time;
if (now - last_full_time > 60 * 1000) {
- branch['low'] = low;
- branch['high'] = high;
- delete branch.elapsed;
+ if (low != "-1") {
+ branch['low'] = low;
+ branch['high'] = high;
+ delete branch.elapsed;
+ }
chart.last_full_time = now;
}
@@ -435,6 +437,14 @@
var branch = wooly.session.branch(href);
+ // don't allow high < low
+ var iLow = parseFloat(low, 10);
+ var iHigh = parseFloat(high, 10);
+ if (iHigh < iLow) {
+ low = high;
+ high = iLow + "";
+ }
+
branch['low'] = low;
branch['high'] = high;
if (branch.elapsed)
15 years, 5 months
rhmessaging commits: r3492 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-13 18:01:15 -0400 (Mon, 13 Jul 2009)
New Revision: 3492
Modified:
mgmt/trunk/cumin/python/cumin/stat.py
Log:
Make control grid color white
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2009-07-13 20:17:06 UTC (rev 3491)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2009-07-13 22:01:15 UTC (rev 3492)
@@ -989,6 +989,7 @@
chart.control.bg_colour = "#DDDDDD"
chart.control.x_axis = XAxis().get_x_axis(self.one_day, 0, tick_height=10)
chart.control.x_axis.labels.colour = "#333333"
+ chart.control.x_axis.grid_colour = "#FFFFFF"
samples = self.fetch_samples(object, self.one_day, 60, "avg", mode, False, stats, end_seconds_ago=0)
max_value, min_value = self.get_max_min(session, stats, samples)
self.make_chart_lines(session, chart.control, "line", stats, 1, 0, 1, samples, self.one_day, 0, mode)
15 years, 5 months
rhmessaging commits: r3491 - mgmt/trunk/cumin/resources.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-13 16:17:06 -0400 (Mon, 13 Jul 2009)
New Revision: 3491
Modified:
mgmt/trunk/cumin/resources/app.js
mgmt/trunk/cumin/resources/open-flash-chart.swf
Log:
Fix bug where only 10 minutes of data would display after a 1 minute.
Modified: mgmt/trunk/cumin/resources/app.js
===================================================================
--- mgmt/trunk/cumin/resources/app.js 2009-07-13 19:58:14 UTC (rev 3490)
+++ mgmt/trunk/cumin/resources/app.js 2009-07-13 20:17:06 UTC (rev 3491)
@@ -94,9 +94,10 @@
}
}
- this.setupChart = function (id, fullpage_url) {
- cumin.setFullpageHandler(id, fullpage_url);
+ this.setupChart = function (id, width) {
var chart = $(id);
+ chart.onfullpage = function (width, height) { cumin.chartNotify(true, width, height, id); };
+ chart.onrestore = function () { cumin.chartNotify(false, width, 100, id); };
var oImg = document.images[id];
var mImg = $(oImg);
mImg.addEvent('load', function () {
@@ -372,7 +373,7 @@
}
/* called from .swf in response to chart.get_ymax() */
-function got_ymax(id, href, axis_max, vals_max) {
+function got_ymax(id, href, axis_max, vals_max, low, high) {
var chart = cumin.getFlashChart(id);
if (chart == null)
return false;
@@ -380,13 +381,26 @@
var branch = wooly.session.branch(href);
var now = new Date().getTime();
- var then = 0;
+ var then = now - 10 * 1000;
if (typeof chart.last_time != "undefined") {
then = chart.last_time;
}
chart.last_time = now;
var elapsed = now - then;
branch['elapsed'] = elapsed; // milliseconds since last update
+
+ // hack: do a full update every minute
+ if (typeof chart.last_full_time == "undefined") {
+ chart.last_full_time = now;
+ }
+ var last_full_time = chart.last_full_time;
+ if (now - last_full_time > 60 * 1000) {
+ branch['low'] = low;
+ branch['high'] = high;
+ delete branch.elapsed;
+ chart.last_full_time = now;
+ }
+
branch['amax'] = axis_max;
branch['vmax'] = vals_max;
@@ -413,3 +427,20 @@
}
});
+function ofc_range(id, href, low, high) {
+ var chart = cumin.getFlashChart(id);
+ if (chart) {
+ var now = new Date().getTime();
+ chart.last_full_time = now;
+
+ var branch = wooly.session.branch(href);
+
+ branch['low'] = low;
+ branch['high'] = high;
+ if (branch.elapsed)
+ delete branch.elapsed;
+
+ href = branch.marshal();
+ chart.reload(href, true);
+ }
+}
\ No newline at end of file
Modified: mgmt/trunk/cumin/resources/open-flash-chart.swf
===================================================================
(Binary files differ)
15 years, 5 months
rhmessaging commits: r3490 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
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}"});
15 years, 5 months
rhmessaging commits: r3489 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-13 13:35:24 -0400 (Mon, 13 Jul 2009)
New Revision: 3489
Modified:
mgmt/trunk/cumin/python/cumin/stat.py
Log:
Removed debugging print statement.
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2009-07-13 17:32:39 UTC (rev 3488)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2009-07-13 17:35:24 UTC (rev 3489)
@@ -795,7 +795,7 @@
# create the chart dict
chart = self.get_chart(session, object, stats, samples, time_span, max_value, min_value, append, end_seconds_ago)
- print "**********\n"+chart.create()
+ #print "**********\n"+chart.create()
return chart.create()
def get_chart(self, session, object, stats, samples, duration, max_value, min_value, append, end_secs):
15 years, 5 months
rhmessaging commits: r3488 - in mgmt/trunk/cumin: resources and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-13 13:32:39 -0400 (Mon, 13 Jul 2009)
New Revision: 3488
Modified:
mgmt/trunk/cumin/python/cumin/stat.py
mgmt/trunk/cumin/resources/open-flash-chart.swf
Log:
Add a "control" chart to bottom of flash charts when in fullpage mode.
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2009-07-13 17:31:38 UTC (rev 3487)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2009-07-13 17:32:39 UTC (rev 3488)
@@ -119,6 +119,7 @@
params.append("class=%s" % cls)
params.append("id=%i" % object.id)
+ params.append("chart_id=%s" % self.render_id(session, None))
for stat in self.stats:
params.append("stat=%s" % stat)
@@ -642,8 +643,50 @@
params = self.get_href_params(session, object)
params.append("width=%i" % self.render_width(session, object))
params.append("height=%i" % self.render_height(session, object))
+ params.append("high=1")
return escape_entity("%s?" % self.get_flash_name(session) + ";".join(params))
+class XAxis(object):
+ def get_x_labels(self, duration, intervals, step, end_secs):
+ x_step = float(duration) / float(intervals)
+ labels = list()
+ for i in range(0, intervals + 1):
+ label = dict()
+ if i % step == 0:
+ value = int(round(duration - i * x_step + end_secs))
+ text = fmt_duration_brief(value)
+
+ label["text"] = text
+ else:
+ label["text"] = ""
+ label["x"] = i * x_step
+
+ labels.append(label)
+ return labels
+
+ def get_x_axis(self, duration, end_secs, tick_height=0):
+ x_intervals = 8
+ x_steps = 2
+ if duration == 600:
+ x_intervals = 10
+
+ x_axis = Element()
+ x_axis.colour = "#CCCCCC"
+ x_axis.grid_colour = "#DDDDDD"
+ x_axis.stroke = 1
+ x_axis.tick_height = tick_height
+
+ xlbls = Element()
+ xlbls.size = 12
+ xlbls.colour = "#999999"
+ xlbls.align = "auto"
+ xlbls.rotate = 0.0001
+
+ lbls = self.get_x_labels(duration, x_intervals, x_steps, end_secs)
+ xlbls.labels = lbls
+ x_axis.labels = xlbls
+ return x_axis
+
class FlashChart(Widget):
colors = ('#FF0000', '#0000FF', '#00FF00', '#FF00FF', '#FFFF00', '#00FFFF', '#000000')
one_day = 24 * 60 * 60
@@ -651,19 +694,89 @@
super(FlashChart, self).__init__(app, name)
self.page = page
+ def pos_to_seconds(self, pos):
+ """ convert the flash chart slider position into a number of seconds ago """
+
+ return int(round((1.0 - float(pos)) * self.one_day))
+
+ def get_end_seconds(self, session):
+ """ how many seconds ago the chart time span ends """
+
+ cmax = self.page.control_max.get(session)
+ if cmax:
+ end_seconds_ago = self.pos_to_seconds(cmax)
+ else:
+ end_seconds_ago = 0
+ return end_seconds_ago
+
+ def get_time_span(self, session):
+ """ the number of seconds between the chart begin and end """
+
+ cmax = self.page.control_max.get(session)
+ if cmax:
+ cmin = self.page.control_min.get(session)
+ start_seconds_ago = self.pos_to_seconds(cmin)
+ end_seconds_ago = self.pos_to_seconds(cmax)
+ return start_seconds_ago - end_seconds_ago
+ else:
+ return self.page.duration.get(session)
+
+ def get_elapsed(self, session):
+ """ load the javascript milliseconds since last update into a dict """
+
+ elapsed = {'seconds': 0, 'milliseconds': 0.0, 'value': 0.0}
+ e = self.page.elapsed.get(session)
+ if e:
+ js_milliseconds = long(e)
+ seconds = int(js_milliseconds / 1000)
+ milliseconds = (js_milliseconds % 1000.0) / 1000.0
+ elapsed['seconds'] = seconds
+ elapsed['milliseconds'] = milliseconds
+ elapsed['value'] = seconds + milliseconds
+ return elapsed
+
+ def get_duration(self, session):
+ """ the number of seconds we want to get a sample for """
+
+ duration = self.page.duration.get(session)
+ e = self.page.elapsed.get(session)
+ if e:
+ elapsed = self.get_elapsed(session)
+ if elapsed['seconds'] <= self.one_day:
+ duration = elapsed['seconds'] + 1
+ else:
+ duration = self.get_time_span(session)
+ return duration
+
+ def get_delta(self, session):
+ """ if we get an elapsed parameter, we want
+ to send only the new values, that is
+ unless the elapsed value is too large
+ in which case we want to get the entire sample """
+
+ e = self.page.elapsed.get(session)
+ if e:
+ elapsed = self.get_elapsed(session)
+ if elapsed['seconds'] <= self.one_day:
+ return True
+ return False
+
def create(self, session, object, stats):
# get the page parameters
width = self.page.container_width.get(session)
height = self.page.container_height.get(session)
mode = self.page.mode.get(session)
+ method = self.page.method.get(session)
+
+ time_span = self.get_time_span(session)
duration = self.get_duration(session)
- time_period = self.page.duration.get(session)
+ end_seconds_ago = self.get_end_seconds(session)
delta = self.get_delta(session)
+
interval = self.page.get_interval(session, duration, width)
- method = self.page.method.get(session)
# get the most recent samples
- samples = self.fetch_samples(object, duration, interval, method, mode, delta, stats)
+ samples = self.fetch_samples(object, duration, interval, method, mode, delta, stats, end_seconds_ago=end_seconds_ago)
max_value, min_value = self.get_max_min(session, stats, samples)
append = False
@@ -675,66 +788,19 @@
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:
- #print "change in axis: axis_max=%s vals_max=%s max_new_values=%s vals_axis=%s desired_axis=%s" % (str(axis_max), str(vals_max), str(max_value), str(axis_for_vals), str(max_of_axiis))
- duration = time_period
- samples = self.fetch_samples(object, duration, interval, method, mode, False, stats)
+ samples = self.fetch_samples(object, time_span, interval, method, mode, False, stats, end_seconds_ago=end_seconds_ago)
max_value, min_value = self.get_max_min(session, stats, samples)
else:
append = True
# create the chart dict
- chart = self.get_chart(session, stats, samples, duration, max_value, min_value, append)
+ chart = self.get_chart(session, object, stats, samples, time_span, max_value, min_value, append, end_seconds_ago)
+ print "**********\n"+chart.create()
return chart.create()
- def get_chart(self, session, stats, samples, duration, max_value, min_value, append):
+ def get_chart(self, session, object, stats, samples, duration, max_value, min_value, append, end_secs):
return Chart()
- def get_duration(self, session):
- duration = self.page.duration.get(session)
- elapsed = self.get_elapsed(session)
- if elapsed['seconds'] <= self.one_day:
- duration = elapsed['seconds'] + 1
- return duration
-
- def get_elapsed(self, session):
- elapsed = {'seconds': 0, 'milliseconds': 0.0, 'value': 0.0}
- e = self.page.elapsed.get(session)
- if e:
- js_milliseconds = long(e)
- seconds = int(js_milliseconds / 1000)
- milliseconds = (js_milliseconds % 1000.0) / 1000.0
- elapsed['seconds'] = seconds
- elapsed['milliseconds'] = milliseconds
- elapsed['value'] = seconds + milliseconds
- return elapsed
-
- def get_delta(self, session):
- """ if we get an elapsed parameter, we want
- to send only the new values, that is
- unless the elapsed value is too large
- in which case we want to get the entire sample """
- elapsed = self.get_elapsed(session)
- if elapsed['seconds'] <= self.one_day:
- return True
- return False
-
- def get_x_labels(self, duration, intervals, step):
- x_step = duration / intervals
- labels = list()
- for i in range(0, intervals + 1):
- label = dict()
- if i % step == 0:
- value = duration - i * x_step
- text = fmt_duration_brief(value)
-
- label["text"] = text
- else:
- label["text"] = ""
- label["x"] = i * x_step
-
- labels.append(label)
- return labels
-
def get_y_labels(self, absy, intervals, step):
y_step = absy / intervals
labels = list()
@@ -759,29 +825,6 @@
labels.append(label)
return labels
- def get_x_axis(self, duration):
- x_intervals = 8
- x_steps = 2
- if duration == 600:
- x_intervals = 10
- steps = int(duration / x_intervals)
-
- x_axis = Element()
- x_axis.colour = "#CCCCCC"
- x_axis.grid_colour = "#DDDDDD"
- x_axis.stroke = 1
- x_axis.steps = steps
- xlbls = Element()
- #xlbls.steps = steps
- xlbls.size = 12
- xlbls.colour = "#999999"
- xlbls.align = "auto"
- xlbls.rotate = 0.0001
- lbls = self.get_x_labels(duration, x_intervals, x_steps)
- xlbls.labels = lbls
- x_axis.labels = xlbls
- return x_axis
-
def get_y_axis(self, max_value, min_value):
y_intervals = 6
absy = max_value - min_value
@@ -790,12 +833,12 @@
if int(max_value) < 3:
y_steps = 3
- # .swf won't show grid lines with a y_axis on the left
+ # .swf won't show grid lines without a y_axis on the left
y_axis = {
"min": int(min_value),
"max": int(max_value),
"steps": y_steps,
- "stroke": 0,
+ "stroke": 1,
"tick-length": 0,
"colour": "#CCCCCC",
"grid-colour": "#DDDDDD",
@@ -816,14 +859,12 @@
self.alpha = 0.3
- def fetch_samples(self, object, dur, interval, method, mode, delta, stats):
+ 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
- if delta: # need more than 1 point for calculating rate
- dur *= 4;
for stat in stats:
- os = stat.samples(object, dur, interval, method)
+ os = stat.samples(object, dur, interval, method, secs2=end_seconds_ago)
ns = list()
prev = None
@@ -839,7 +880,7 @@
samples[stat] = ns
else:
for stat in stats:
- samples[stat] = stat.samples(object, dur, interval, method)
+ samples[stat] = stat.samples(object, dur, interval, method, secs2=end_seconds_ago)
return samples
@@ -861,10 +902,9 @@
return max_value, min_value
- def get_vals(self, session, samples, stat, text):
+ def get_vals(self, session, samples, stat, text, duration, end_secs):
tnow = time()
- time_period = self.page.duration.get(session)
- vals = [{"x":int(time_period -(tnow - secs(dt))),
+ vals = [{"x":int(duration -(tnow - secs(dt)) + end_secs),
"y":value,
"uid": dt.strftime("%m%d%Y%H%M%S"),
"tip": "<br>%s: #val#<br>Time: %s" % (text, dt.strftime("%m/%d/%Y %H:%M:%S"))}
@@ -872,24 +912,11 @@
if value is not None]
return vals
- def get_chart(self, session, stats, samples, duration, max_value, min_value, append):
- mode = self.page.mode.get(session)
-
- width = self.page.container_width.get(session)
- dot_size = 1
- halo_size = 0
- line_width = 1
- if width > 400:
- dot_size = 3
- halo_size = 1
- line_width = 2
-
- chart = Chart()
- chart.bg_colour = "#FFFFFF"
+ def make_chart_lines(self, session, chart, line_type, stats, dot_size, halo_size, line_width, samples, duration, end_secs, mode):
chart.elements = list()
for stat, color in reversed(zip(stats, self.colors)):
line = Element()
- line.type = "area"
+ line.type = line_type
line.fill = color
line.fill_alpha = self.alpha
line.on_show.type = "No"
@@ -901,9 +928,27 @@
line.width = line_width
line.text = mode == "rate" and "%s / sec" % stat.title or stat.title
- line.values = self.get_vals(session, samples, stat, line.text)
+ vals = self.get_vals(session, samples, stat, line.text, duration, end_secs)
+ line.values = vals
chart.elements.append(line)
+ def get_chart(self, session, object, stats, samples, duration, max_value, min_value, append, end_secs):
+ mode = self.page.mode.get(session)
+
+ width = self.page.container_width.get(session)
+ dot_size = 1
+ halo_size = 0
+ line_width = 1
+ if width > 400:
+ dot_size = 3
+ halo_size = 1
+ line_width = 2
+
+ chart = Chart()
+ chart.id = self.page.chart_id.get(session);
+ chart.bg_colour = "#FFFFFF"
+ self.make_chart_lines(session, chart, "area", stats, dot_size, halo_size, line_width, samples, duration, end_secs, mode)
+
if append:
chart.append = self.get_elapsed(session)['value']
#print "append: duration=%i elapsed=%f" % (duration, float(self.get_elapsed(session)['value']))
@@ -918,11 +963,26 @@
"body": "{font-size: 10px; color: #000000;}"
}
- chart.x_axis = self.get_x_axis(duration)
+ chart.x_axis = XAxis().get_x_axis(duration, end_secs)
y_axis, y_axis_right = self.get_y_axis(max_value, min_value)
chart.y_axis = y_axis
chart.y_axis_right = y_axis_right
+ # if we are big enough, add a control slider to pan and zoom
+ if width > 400:
+ chart.control.bg_colour = "#DDDDDD"
+ chart.control.x_axis = XAxis().get_x_axis(self.one_day, 0, tick_height=10)
+ chart.control.x_axis.labels.colour = "#333333"
+ samples = self.fetch_samples(object, self.one_day, 60, "avg", mode, False, stats, end_seconds_ago=0)
+ max_value, min_value = self.get_max_min(session, stats, samples)
+ self.make_chart_lines(session, chart.control, "line", stats, 1, 0, 1, samples, self.one_day, 0, mode)
+ chart.control.y_min = max(min_value, 0)
+ chart.control.y_max = max(max_value-2, 1)
+ chart.control.slider_low.value = float(self.page.control_min.get(session))
+ chart.control.slider_low.colour = "#666666"
+ chart.control.slider_high.value = float(self.page.control_max.get(session))
+ chart.control.slider_high.colour = "#666666"
+
#print "sending entire sample set with y_axis.max=%i" % chart.y_axis["max"]
return chart
@@ -967,14 +1027,13 @@
return max_value, min_value
- def get_vals(self, session, samples, stat, text):
+ def get_vals(self, session, samples, stat, text, duration, end_secs):
tnow = time()
- time_period = self.page.duration.get(session)
points = self.points.get(session)
vals = list()
if points:
- vals = [{"x":int(time_period -(tnow - secs(dt))),
+ vals = [{"x":int(duration -(tnow - secs(dt)) + end_secs),
"y":stacked_value,
"uid": dt.strftime("%m%d%Y%H%M%S"),
"tip": "<br>%s: %s<br>Time: %s" % (text, str(value), dt.strftime("%m/%d/%Y %H:%M:%S"))}
@@ -1010,6 +1069,18 @@
self.chart_type.default = "area"
self.add_parameter(self.chart_type)
+ self.chart_id = Parameter(app, "chart_id")
+ self.add_parameter(self.chart_id)
+
+ self.control_min = Parameter(app, "low")
+ ten_min_of_day = 10.0 / (24.0 * 60.0)
+ self.control_min.default = str(1.0 - ten_min_of_day)
+ self.add_parameter(self.control_min)
+
+ self.control_max = Parameter(app, "high")
+ self.control_max.default = None
+ self.add_parameter(self.control_max)
+
def get_content_type(self, session):
return "text/plain"
Modified: mgmt/trunk/cumin/resources/open-flash-chart.swf
===================================================================
(Binary files differ)
15 years, 5 months
rhmessaging commits: r3487 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-13 13:31:38 -0400 (Mon, 13 Jul 2009)
New Revision: 3487
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Change the way samples() ensures it gets at least 2 sampels for rate charts.
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2009-07-10 20:10:34 UTC (rev 3486)
+++ mgmt/trunk/cumin/python/cumin/model.py 2009-07-13 17:31:38 UTC (rev 3487)
@@ -582,12 +582,16 @@
nname.append(c)
return "".join(nname)
- def avg_samples(self, object, secs, interval):
+ def avg_samples(self, object, secs, interval, secs2):
conn = self.get_connection()
- when = "(qmf_update_time >= now() - interval '%i seconds')" % int(secs + 12)
- where = "%s and %s" % (object.stats.clause, when)
+ when = "(qmf_update_time >= now() - interval '%i seconds')" % int(secs + secs2)
+ when2 = ""
+ if secs2:
+ when2 = " and (qmf_update_time <= now() - interval '%i seconds')" % int(secs2)
+ where = "%s and %s%s" % (object.stats.clause, when, when2)
+
table_name = self.cumin_class.mint_stats_class.q.tableName
field_name = self.get_db_name()
@@ -608,21 +612,24 @@
cursor.execute(sql)
return cursor.fetchall()
- def samples(self, object, secs, interval, method):
+ def samples(self, object, secs, interval, method, secs2=0):
if method == "avg":
- return self.avg_samples(object, secs, interval)
+ return self.avg_samples(object, secs, interval, secs2)
stats = object.stats
now = datetime.now()
+ upper_limit = now - timedelta(seconds=int(secs2))
+ lower_limit = now - timedelta(seconds=int(secs + secs2))
+ col = self.cumin_class.mint_stats_class.q.qmfUpdateTime
+ stats = stats.filter(col <= upper_limit)
- col = self.cumin_class.mint_stats_class.q.qmfUpdateTime
def ensure_at_least(min_count, more_time):
- dt = now - timedelta(seconds=int(secs + more_time))
+ dt = now - timedelta(seconds=int(secs + secs2 + more_time))
stats2 = stats.filter(col >= dt)
if stats2.count() < min_count:
- more_time += 30
- if more_time <= 24 * 60 * 60:
+ more_time += 60
+ if more_time <= 60 * 60:
return ensure_at_least(min_count, more_time)
return stats2
@@ -631,17 +638,19 @@
samples = list()
- limit = now - timedelta(seconds=secs)
next_is_last = False
for stat in stats:
+ if (stat.qmfUpdateTime > upper_limit):
+ continue
+
value = getattr(stat, self.name, 0)
samples.append((stat.qmfUpdateTime, value))
if next_is_last:
break
- if stat.qmfUpdateTime < limit:
+ if stat.qmfUpdateTime < lower_limit:
next_is_last = True
return samples
15 years, 5 months
rhmessaging commits: r3486 - store/trunk/cpp/tests/cluster.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-07-10 16:10:34 -0400 (Fri, 10 Jul 2009)
New Revision: 3486
Modified:
store/trunk/cpp/tests/cluster/run_cluster_tests
Log:
Script bugfix
Modified: store/trunk/cpp/tests/cluster/run_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_cluster_tests 2009-07-10 19:43:58 UTC (rev 3485)
+++ store/trunk/cpp/tests/cluster/run_cluster_tests 2009-07-10 20:10:34 UTC (rev 3486)
@@ -23,7 +23,7 @@
srcdir=`dirname $0`
-if test $1 == "LONG_TEST"; then
+if test x$1 == x"LONG_TEST"; then
echo "Running long tests..."
LONG_TEST=1
fi
15 years, 5 months
rhmessaging commits: r3485 - in store/trunk/cpp: tests/cluster and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-07-10 15:43:58 -0400 (Fri, 10 Jul 2009)
New Revision: 3485
Modified:
store/trunk/cpp/rhel4-support/rhel4.patch
store/trunk/cpp/tests/cluster/Makefile.am
store/trunk/cpp/tests/jrnl/jtt/_ut_data_src.cpp
Log:
Fixes to valgrind suppression file for 32-bit RHEL4, also fix for RHEL4 check-long make error
Modified: store/trunk/cpp/rhel4-support/rhel4.patch
===================================================================
--- store/trunk/cpp/rhel4-support/rhel4.patch 2009-07-10 15:18:41 UTC (rev 3484)
+++ store/trunk/cpp/rhel4-support/rhel4.patch 2009-07-10 19:43:58 UTC (rev 3485)
@@ -1,6 +1,6 @@
Index: tests/.valgrind.supp
===================================================================
---- tests/.valgrind.supp (revision 3413)
+--- tests/.valgrind.supp (revision 3484)
+++ tests/.valgrind.supp (working copy)
@@ -1,32 +1,74 @@
{
@@ -11,9 +11,9 @@
- obj:*/libcpg.so.2.0.0
+ <insert a suppression name here>
+ Memcheck:Leak
-+ fun:_Znwm
-+ fun:_ZNSs4_Rep9_S_createEmmRKSaIcE
-+ obj:/usr/lib64/libstdc++.so.6.0.3
++ fun:_Znw?
++ fun:_ZNSs4_Rep9_S_createE??RKSaIcE
++ obj:*/libstdc++.so.6.0.3
+ fun:_ZNSsC1EPKcRKSaIcE
+ fun:_ZN4qpid34options_description_less_easy_initclEPKcPKN5boost15program_options14value_semanticES2_
+ fun:_ZN4qpid3log5posix11SinkOptionsC1ERKSs
@@ -60,7 +60,7 @@
- fun:epoll_ctl
+ <insert a suppression name here>
+ Memcheck:Leak
-+ fun:_Znwm
++ fun:_Znw?
+ fun:_ZNSt6vectorISsSaISsEE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPSsS1_EERKSs
+ fun:_ZN4qpid7Options14register_namesESs
+ fun:_ZN4qpid34options_description_less_easy_initclEPKcPKN5boost15program_options14value_semanticES2_
@@ -90,7 +90,7 @@
+ Memcheck:Leak
+ fun:calloc
+ fun:_dl_allocate_tls
-+ fun:pthread_create@@GLIBC_2.2.5
++ fun:pthread_create@@GLIBC_2.*
+}
+{
+ <insert a suppression name here>
Modified: store/trunk/cpp/tests/cluster/Makefile.am
===================================================================
--- store/trunk/cpp/tests/cluster/Makefile.am 2009-07-10 15:18:41 UTC (rev 3484)
+++ store/trunk/cpp/tests/cluster/Makefile.am 2009-07-10 19:43:58 UTC (rev 3485)
@@ -25,7 +25,6 @@
if HAVE_LIBCPG
-
AM_CXXFLAGS = $(WARNING_CFLAGS) -pthread -DBOOST_TEST_DYN_LINK
INCLUDES=-I$(top_srcdir)/lib $(QPID_CXXFLAGS)
@@ -59,4 +58,9 @@
check-long:
$(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
-endif
\ No newline at end of file
+else
+
+check-long:
+ @echo "Cluster tests skipped - HAVE_LIBCPG not defined."
+
+endif
Modified: store/trunk/cpp/tests/jrnl/jtt/_ut_data_src.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/_ut_data_src.cpp 2009-07-10 15:18:41 UTC (rev 3484)
+++ store/trunk/cpp/tests/jrnl/jtt/_ut_data_src.cpp 2009-07-10 19:43:58 UTC (rev 3485)
@@ -146,7 +146,7 @@
::srand48(seed);
const std::size_t num = 1024;
- cout << test_filename << ".xid_data_xid: seed=0x" << std::hex << seed << std::dec << flush;
+ cout << test_filename << ".xid_data_xid seed=0x" << std::hex << seed << std::dec << ": " << flush;
BOOST_CHECK_EQUAL(data_src::get_xid(1), "0");
BOOST_CHECK_EQUAL(data_src::get_xid(2), "01");
BOOST_CHECK_EQUAL(data_src::get_xid(3), "002");
15 years, 5 months