rhmessaging commits: r3506 - in mgmt/trunk/cumin: resources and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-16 18:21:38 -0400 (Thu, 16 Jul 2009)
New Revision: 3506
Modified:
mgmt/trunk/cumin/python/cumin/stat.py
mgmt/trunk/cumin/python/cumin/stat.strings
mgmt/trunk/cumin/resources/app.js
Log:
Start to support pie charts
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2009-07-16 22:21:09 UTC (rev 3505)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2009-07-16 22:21:38 UTC (rev 3506)
@@ -219,6 +219,10 @@
def render_height(self, session, object):
return 120
+class PieFlashChart(StatFlashChart):
+ def render_height(self, session, object):
+ return 200
+
class ImageCache(object):
def __init__(self):
self.__files = dict() # {name: {"time": time_created, "file": file object, "cookie": (cookie values)}}
@@ -365,6 +369,30 @@
cookie = "|".join((str(x) for x in args))
session.set_cookie("slot_info", cookie)
+class PieChartPage(Page):
+ def __init__(self, app, name):
+ super(PieChartPage, self).__init__(app, name)
+
+ self.class_ = CuminClassParameter(app, "class")
+ self.add_parameter(self.class_)
+
+ self.id = IntegerParameter(app, "id")
+ self.add_parameter(self.id)
+
+ param = Parameter(app, "param")
+ self.add_parameter(param)
+
+ self.stats = ListParameter(app, "stat", param)
+ self.add_parameter(self.stats)
+
+ def get_cache_control(self, session):
+ return "no-cache"
+
+ def get_object(self, session):
+ cls = self.class_.get(session).mint_class
+ id = self.id.get(session)
+ return (cls.get(id),)
+
class StatChartPage(Page):
def __init__(self, app, name):
super(StatChartPage, self).__init__(app, name)
@@ -687,11 +715,59 @@
x_axis.labels = xlbls
return x_axis
-class FlashChart(Widget):
+class FlashPieChart(Widget):
+ def __init__(self, app, name, page):
+ super(FlashPieChart, self).__init__(app, name)
+ self.page = page
+ colors = ['#FF0000', '#0000FF', '#00FF00', '#FF00FF', '#00FFFF', '#000000', '#666600']
+
+ def create(self, session, object):
+ #stat = self.page.stats.get(session)[0]
+ #action = self.app.model.negotiator.GetStats
+ #group_stats = action.do_invoke(negotiator, 'developer')
+ chart = Chart()
+ chart.title.text = ""
+ chart.bg_colour = "#FFFFFF"
+
+ chart.elements = list()
+ element = Element()
+ element.type = "pie"
+ element.alpha = 0.7
+ element.start_angle = 0
+ element.gradient_fill = True
+ element.radius = 90
+
+ element.animate = list()
+ animation = Element()
+ animation.type = "fade"
+ element.animate.append(animation)
+ animation = Element()
+ animation.type = "bounce"
+ animation.distance = 8
+ element.animate.append(animation)
+
+ element.tip = "#percent# (Click to modify)"
+ element.colours = self.colors
+ element.on_click = "ofc_change_priority"
+ id = self.page.chart_id.get(session)
+ element.on_click_text = "#val#|#label#|%s" % id
+ element.values = [
+ {"value": 2, "label": "fah"},
+ {"value": 4, "label": "Development"},
+ {"value": 7, "label": "Accounting"},
+ {"value": 70, "label": "Rendering"},
+ {"value": 6, "label": "Reporting"},
+ {"value": 9, "label": "Management"}
+ ]
+
+ chart.elements.append(element)
+ return chart.create()
+
+class FlashLineChart(Widget):
colors = ('#FF0000', '#0000FF', '#00FF00', '#FF00FF', '#FFFF00', '#00FFFF', '#000000')
one_day = 24 * 60 * 60
def __init__(self, app, name, page):
- super(FlashChart, self).__init__(app, name)
+ super(FlashLineChart, self).__init__(app, name)
self.page = page
def pos_to_seconds(self, pos):
@@ -766,12 +842,13 @@
return None
return method
- def create(self, session, object, stats):
+ def create(self, session, object):
# 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)
+ stats = self.page.get_stats(session)
time_span = self.get_time_span(session)
duration = self.get_duration(session)
@@ -870,7 +947,7 @@
def get_chart(self, session, object, stats, samples, duration, max_value, min_value, append, end_secs):
return Chart()
-class AreaChart(FlashChart):
+class AreaChart(FlashLineChart):
def __init__(self, app, name, page):
super(AreaChart, self).__init__(app, name, page)
@@ -954,11 +1031,10 @@
width = self.page.container_width.get(session)
dot_size = 1
halo_size = 0
- line_width = 1
+ line_width = 0
if width > 400:
dot_size = 3
halo_size = 1
- line_width = 2
chart = Chart()
chart.id = self.page.chart_id.get(session);
@@ -1104,13 +1180,15 @@
def get_content_type(self, session):
return "text/plain"
+ def get_stats(self, session):
+ return [getattr(cls, x) for x in self.stats.get(session)]
+
def do_render(self, session):
object = self.get_object(session)[0]
cls = self.class_.get(session)
- stats = [getattr(cls, x) for x in self.stats.get(session)]
chart = self.chart_factory(self.chart_type.get(session))
- return chart.create(session, object, stats)
+ return chart.create(session, object)
def chart_factory(self, chart_type):
if chart_type == "area":
@@ -1118,6 +1196,8 @@
elif chart_type == "stacked":
chart_obj = StackedAreaChart(self.app, chart_type, self)
#chart_obj = StackedChart(self.app, chart_type, self)
+ elif chart_type == "pie":
+ chart_obj = FlashPieChart(self.app, chart_type, self)
return chart_obj
Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings 2009-07-16 22:21:09 UTC (rev 3505)
+++ mgmt/trunk/cumin/python/cumin/stat.strings 2009-07-16 22:21:38 UTC (rev 3506)
@@ -296,3 +296,22 @@
}
//]]>
</script>
+
+[PieFlashChart.html]
+<div>
+ <div class="StatValueChart" id="{id}">
+ <h2>{title}</h2>
+ <div id="{id}_chart">
+ </div>
+ </div>
+</div>
+<script type="text/javascript">
+//<![CDATA[
+ var flashversion = swfobject.getFlashPlayerVersion();
+ if (flashversion.major >= 9) {
+ swfobject.embedSWF("resource?name=open-flash-chart.swf", "{id}_chart", "{width}", "{height}", "9.0.0", "",
+ {"data-file":"{href}"});
+ }
+//]]>
+</script>
+
Modified: mgmt/trunk/cumin/resources/app.js
===================================================================
--- mgmt/trunk/cumin/resources/app.js 2009-07-16 22:21:09 UTC (rev 3505)
+++ mgmt/trunk/cumin/resources/app.js 2009-07-16 22:21:38 UTC (rev 3506)
@@ -453,4 +453,15 @@
href = branch.marshal();
chart.reload(href, true);
}
+}
+
+function ofc_change_priority() {
+ var args = "(";
+ var sep = "";
+ for (var i=0; i<arguments.length; i++) {
+ args += sep+arguments[i];
+ sep = ", ";
+ }
+ args += ")";
+ alert("change priority " + args);
}
\ No newline at end of file
15 years, 5 months
rhmessaging commits: r3505 - mgmt/trunk/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-16 18:21:09 -0400 (Thu, 16 Jul 2009)
New Revision: 3505
Modified:
mgmt/trunk/cumin/python/cumin/grid/negotiator.py
Log:
Added negotiator overview tab with a pie chart
Modified: mgmt/trunk/cumin/python/cumin/grid/negotiator.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/negotiator.py 2009-07-16 22:20:17 UTC (rev 3504)
+++ mgmt/trunk/cumin/python/cumin/grid/negotiator.py 2009-07-16 22:21:09 UTC (rev 3505)
@@ -87,9 +87,32 @@
self.__tabs = TabbedModeSet(app, "tabs")
self.add_child(self.__tabs)
+ overview = NegotiatorOverview(app, "overview")
+ self.__tabs.add_tab(overview)
+
details = CuminDetails(app, "details")
self.__tabs.add_tab(details)
+class NegotiatorOverview(Widget):
+ def __init__(self, app, name):
+ super(NegotiatorOverview, self).__init__(app, name)
+
+ chart = self.PriorityPieChart(app, "chart")
+ self.add_child(chart)
+
+ def render_title(self, session):
+ return "Overview"
+
+ class PriorityPieChart(PieFlashChart):
+ def __init__(self, app, name):
+ super(NegotiatorOverview.PriorityPieChart, self).__init__(app, name)
+
+ self.chart_type = "pie"
+ self.stats = ("priority",)
+
+ def render_title(self, session, sched):
+ return "Group Priority"
+
class NegotiatorStartForm(CuminTaskForm):
def __init__(self, app, name, task):
super(NegotiatorStartForm, self).__init__(app, name, task)
15 years, 5 months
rhmessaging commits: r3504 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-16 18:20:17 -0400 (Thu, 16 Jul 2009)
New Revision: 3504
Modified:
mgmt/trunk/cumin/python/cumin/OpenFlashChart.py
Log:
Add on_click_text to on-click-text replacement key
Modified: mgmt/trunk/cumin/python/cumin/OpenFlashChart.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/OpenFlashChart.py 2009-07-16 22:19:27 UTC (rev 3503)
+++ mgmt/trunk/cumin/python/cumin/OpenFlashChart.py 2009-07-16 22:20:17 UTC (rev 3504)
@@ -27,7 +27,7 @@
class Chart(dict):
# Dictionary for replacing attribute names
replaceKeyDictionary = {
- "on_show": "on-show", "on_click": "on-click",
+ "on_show": "on-show", "on_click": "on-click", "on_click_text": "on-click-text",
"start_angle": "start-angle",
"threeD": "3d", "tick_height": "tick-height",
15 years, 5 months
rhmessaging commits: r3503 - mgmt/trunk/cumin/resources.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-16 18:19:27 -0400 (Thu, 16 Jul 2009)
New Revision: 3503
Modified:
mgmt/trunk/cumin/resources/open-flash-chart.swf
Log:
Allow 0 width lines
Modified: mgmt/trunk/cumin/resources/open-flash-chart.swf
===================================================================
(Binary files differ)
15 years, 5 months
rhmessaging commits: r3502 - store/trunk/cpp/tests/cluster.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-07-16 16:14:33 -0400 (Thu, 16 Jul 2009)
New Revision: 3502
Modified:
store/trunk/cpp/tests/cluster/run_cluster_tests
Log:
Some more debug output to help troubleshoot ptolemy
Modified: store/trunk/cpp/tests/cluster/run_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_cluster_tests 2009-07-16 19:24:37 UTC (rev 3501)
+++ store/trunk/cpp/tests/cluster/run_cluster_tests 2009-07-16 20:14:33 UTC (rev 3502)
@@ -72,6 +72,18 @@
echo "WARNING: environment variable ${var} not set."
fi
done
+ LIBS=(CLUSTER_LIB TEST_STORE_LIB)
+ for lib in ${LIBS[@]}; do
+ if test -x ${!lib}; then
+ echo "WARNING: library \"${lib}\" not found."
+ fi
+ done
+ EXECS=(QPIDD_EXEC QPID_CONFIG_EXEC QPID_ROUTE_EXEC RECEIVER_EXEC SENDER_EXEC)
+ for exec in ${EXECS[@]}; do
+ if test -x ${!exec}; then
+ echo "WARNING: executable \"${exec}\" not found."
+ fi
+ done
fi
export STORE_LIB=${abs_srcdir}/../../lib/.libs/msgstore.so
15 years, 5 months
rhmessaging commits: r3501 - mgmt/trunk/cumin/open-flash-chart/charts.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-16 15:24:37 -0400 (Thu, 16 Jul 2009)
New Revision: 3501
Modified:
mgmt/trunk/cumin/open-flash-chart/charts/Line.as
Log:
Don't draw a line when the line width is 0
Modified: mgmt/trunk/cumin/open-flash-chart/charts/Line.as
===================================================================
--- mgmt/trunk/cumin/open-flash-chart/charts/Line.as 2009-07-16 18:36:28 UTC (rev 3500)
+++ mgmt/trunk/cumin/open-flash-chart/charts/Line.as 2009-07-16 19:24:37 UTC (rev 3501)
@@ -142,13 +142,15 @@
protected function draw_line(): void {
this.graphics.clear();
- this.graphics.lineStyle( this.props.get_colour('width'), this.props.get_colour('colour') );
-
- if( this.line_style.style != 'solid' )
- this.dash_line();
- else
- this.solid_line();
-
+ var width:Number = this.props.get_colour('width');
+ if (width > 0) {
+ this.graphics.lineStyle( width, this.props.get_colour('colour') );
+
+ if( this.line_style.style != 'solid' )
+ this.dash_line();
+ else
+ this.solid_line();
+ }
}
public function move_dots( sc:ScreenCoordsBase ): void {
15 years, 5 months
rhmessaging commits: r3499 - store/trunk/cpp/tests/cluster.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-07-16 14:35:32 -0400 (Thu, 16 Jul 2009)
New Revision: 3499
Modified:
store/trunk/cpp/tests/cluster/run_cluster_tests
Log:
Some debug output to help troubleshoot ptolemy
Modified: store/trunk/cpp/tests/cluster/run_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_cluster_tests 2009-07-16 18:32:50 UTC (rev 3498)
+++ store/trunk/cpp/tests/cluster/run_cluster_tests 2009-07-16 18:35:32 UTC (rev 3499)
@@ -66,7 +66,7 @@
export SENDER_EXEC=${QPID_DIR}/cpp/src/tests/sender
else
# Check expected environment vars are set
- VARS=(CLUSTER_DIR PYTHONPATH QPIDD_EXEC CLUSTER_LIB TEST_STORE_LIB QPID_CONFIG_EXEC QPID_ROUTE_EXEC RECEIVER_EXEC SENDER_EXEC)
+ VARS=(CLUSTER_DIR CPP_CLUSTER_EXEC PYTHONPATH QPIDD_EXEC CLUSTER_LIB TEST_STORE_LIB QPID_CONFIG_EXEC QPID_ROUTE_EXEC RECEIVER_EXEC SENDER_EXEC)
for var in ${VARS[@]}; do
if test -z ${!var}; then
echo "WARNING: environment variable ${var} not set."
@@ -75,6 +75,7 @@
fi
export STORE_LIB=${abs_srcdir}/../../lib/.libs/msgstore.so
+echo "Running C++ cluster tests..."
# Run the C++ cluster tests
if test ! ${LONG_TEST}; then
sg ais -c "${CLUSTER_DIR}/${CPP_CLUSTER_EXEC}"
@@ -120,6 +121,7 @@
PYTHON_CLUSTER_EXEC=cluster_tests.py
fi
+echo "Running Python cluster tests..."
sg ais -c "${CLUSTER_DIR}/${PYTHON_CLUSTER_EXEC} -v"
RETCODE=$?
if test x${RETCODE} != x0; then
15 years, 5 months
rhmessaging commits: r3498 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-07-16 14:32:50 -0400 (Thu, 16 Jul 2009)
New Revision: 3498
Modified:
mgmt/trunk/mint/python/mint/main.py
Log:
Log according to the configured level and file
Modified: mgmt/trunk/mint/python/mint/main.py
===================================================================
--- mgmt/trunk/mint/python/mint/main.py 2009-07-16 18:30:52 UTC (rev 3497)
+++ mgmt/trunk/mint/python/mint/main.py 2009-07-16 18:32:50 UTC (rev 3498)
@@ -1,6 +1,7 @@
import sys
import os
import logging
+
from parsley.config import Config, ConfigParameter
from parsley.loggingex import enable_logging
@@ -79,6 +80,9 @@
hdef = os.path.normpath("/var/lib/mint")
self.home = os.environ.get("MINT_HOME", hdef)
+ if not os.path.isdir(self.home):
+ raise Exception("Home path '%s' is not a directory")
+
param = ConfigParameter(self, "data", str)
param.default = "postgresql://mint@localhost/mint"
@@ -109,7 +113,7 @@
if opts:
self.load_dict(opts)
+ enable_logging("mint", self.log_level, self.log_file)
+
if self.debug:
enable_logging("mint", "debug", sys.stderr)
- else:
- enable_logging("mint", self.log_level, self.log_file)
15 years, 5 months
rhmessaging commits: r3497 - mgmt/trunk/parsley/python/parsley.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-07-16 14:30:52 -0400 (Thu, 16 Jul 2009)
New Revision: 3497
Modified:
mgmt/trunk/parsley/python/parsley/loggingex.py
Log:
Do level filtering on the formatter, not the logger
Modified: mgmt/trunk/parsley/python/parsley/loggingex.py
===================================================================
--- mgmt/trunk/parsley/python/parsley/loggingex.py 2009-07-16 12:33:53 UTC (rev 3496)
+++ mgmt/trunk/parsley/python/parsley/loggingex.py 2009-07-16 18:30:52 UTC (rev 3497)
@@ -22,7 +22,8 @@
fmt = "%(process)d %(asctime)s %(levelname)s %(message)s"
handler.setFormatter(logging.Formatter(fmt))
+ handler.setLevel(level)
log = logging.getLogger(name)
+ log.setLevel(logging.DEBUG)
log.addHandler(handler)
- log.setLevel(level)
15 years, 5 months
rhmessaging commits: r3496 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-07-16 08:33:53 -0400 (Thu, 16 Jul 2009)
New Revision: 3496
Modified:
mgmt/trunk/cumin/python/cumin/stat.py
Log:
Check for a value of None when calculating max and min for stacked charts
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2009-07-15 20:03:09 UTC (rev 3495)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2009-07-16 12:33:53 UTC (rev 3496)
@@ -1024,6 +1024,8 @@
for dt, value, dev in samples[stat]:
if dt == last_dt:
continue
+ if value == None:
+ value = 0
last_dt = dt
if stat not in points:
points[stat] = list()
@@ -1091,7 +1093,8 @@
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)
+ one_hour = 1 / 24.0
+ self.control_min.default = str(1.0 - one_hour)
self.add_parameter(self.control_min)
self.control_max = Parameter(app, "high")
15 years, 5 months