[rhmessaging-commits] rhmessaging commits: r3311 - in mgmt/trunk/cumin/python/cumin: grid and 1 other directory.
rhmessaging-commits at lists.jboss.org
rhmessaging-commits at lists.jboss.org
Mon Apr 20 14:53:05 EDT 2009
Author: eallen
Date: 2009-04-20 14:53:04 -0400 (Mon, 20 Apr 2009)
New Revision: 3311
Modified:
mgmt/trunk/cumin/python/cumin/grid/collector.py
mgmt/trunk/cumin/python/cumin/grid/collector.strings
mgmt/trunk/cumin/python/cumin/model.py
mgmt/trunk/cumin/python/cumin/stat.py
mgmt/trunk/cumin/python/cumin/stat.strings
mgmt/trunk/cumin/python/cumin/visualizations.strings
Log:
Use new collector stats in stacked graphs.
Added Jobs Running / Idle stacked graph
Modified: mgmt/trunk/cumin/python/cumin/grid/collector.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/collector.py 2009-04-20 14:14:01 UTC (rev 3310)
+++ mgmt/trunk/cumin/python/cumin/grid/collector.py 2009-04-20 18:53:04 UTC (rev 3311)
@@ -113,17 +113,25 @@
self.add_child(StatSet(app, "stats", "general"))
- chart = self.StackedChart(app, "utilization")
- chart.stats = ("HostsIdle", "HostsClaimed", "HostsUnclaimed")
+ chart = self.JobStackedChart(app, "jobs")
+ chart.stats = ("RunningJobs", "IdleJobs")
self.add_child(chart)
+ chart = self.SlotStackedChart(app, "slots")
+ chart.stats = ("HostsClaimed", "HostsUnclaimed", "HostsOwner")
+ self.add_child(chart)
+
def render_title(self, session):
return "Statistics"
- class StackedChart(StatStackedChart):
+ class JobStackedChart(StatStackedChart):
def render_title(self, session, *args):
- return "Slot Utilization"
+ return "Job Status"
+ class SlotStackedChart(StatStackedChart):
+ def render_title(self, session, *args):
+ return "Slot State"
+
class CollectorView(CuminView):
def __init__(self, app, name):
super(CollectorView, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/grid/collector.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/collector.strings 2009-04-20 14:14:01 UTC (rev 3310)
+++ mgmt/trunk/cumin/python/cumin/grid/collector.strings 2009-04-20 18:53:04 UTC (rev 3311)
@@ -47,7 +47,14 @@
<h2>Collector Stats</h2>
{stats}
</td>
- <td>{utilization}</td>
+ <td>
+ <div>
+ {jobs}
+ </div>
+ <div>
+ {slots}
+ </div>
+ </td>
</tr>
</tbody>
</table>
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2009-04-20 14:14:01 UTC (rev 3310)
+++ mgmt/trunk/cumin/python/cumin/model.py 2009-04-20 18:53:04 UTC (rev 3311)
@@ -2683,14 +2683,20 @@
action = GetStartedAction(self, "GetStarted")
action.navigable = False
+ stat = CuminStat(self, "RunningJobs")
+ stat.title = "Running Jobs"
+
+ stat = CuminStat(self, "IdleJobs")
+ stat.title = "Idle Jobs"
+
stat = CuminStat(self, "HostsClaimed")
stat.title = "Claimed Slots"
stat = CuminStat(self, "HostsUnclaimed")
stat.title = "Unclaimed Slots"
- stat = CuminStat(self, "HostsIdle")
- stat.title = "Idle Slots"
+ stat = CuminStat(self, "HostsOwner")
+ stat.title = "Owner Slots"
stat = CuminStat(self, "HostsTotal")
stat.title = "Total Slots"
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2009-04-20 14:14:01 UTC (rev 3310)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2009-04-20 18:53:04 UTC (rev 3311)
@@ -471,14 +471,15 @@
duration = self.duration.get(session)
#XXX fake stats for now
- count = self.container_width.get(session) / 3
- t = datetime.now()
- seed(1)
+ #count = self.container_width.get(session) / 3
+ #t = datetime.now()
+ #seed(1)
+ #for stat in stats:
+ # samples[stat] = self.fake_samples(min(count, 200), t, 10)
+
for stat in stats:
- samples[stat] = self.fake_samples(min(count, 200), t, 10)
+ samples[stat] = stat.samples(object, duration)
- #samples[stat] = stat.samples(object, duration)
-
points = dict()
for stat in stats:
for sample in samples[stat]:
Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings 2009-04-20 14:14:01 UTC (rev 3310)
+++ mgmt/trunk/cumin/python/cumin/stat.strings 2009-04-20 18:53:04 UTC (rev 3311)
@@ -148,6 +148,22 @@
<span class="ph" statname="{stat_name}" statmode="{mode}">{stat_value}</span>
</li>
+[StatStackedChart.javascript]
+function stackedNotify(full, width, height, id) {
+ var oImg = document.images[id];
+ if (oImg) {
+ var src = oImg.src;
+ var branch = wooly.session.branch(src);
+ branch.width = Math.max(width - 100, 360);
+ branch.height = Math.max(height - 100, 100);
+ src = branch.marshal();
+
+ src = cumin.refreshTime(src);
+ oImg.style.visibility = "hidden";
+ oImg.src = src;
+ }
+}
+
[StatStackedChart.html]
<div class="StatValueChart fullpageable" id="{id}">
<h2>{title}</h2>
@@ -164,25 +180,12 @@
}
wooly.addPageUpdateListener(update);
-}())
-function stackedNotify(full, width, height) {
- var oImg = document.images['{id}'];
- if (oImg) {
- var src = oImg.src;
- var branch = wooly.session.branch(src);
- branch.width = Math.max(width - 100, 360);
- branch.height = Math.max(height - 100, 100);
- src = branch.marshal();
- src = cumin.refreshTime(src);
- oImg.style.visibility = "hidden";
- oImg.src = src;
- }
-}
- $('{id}').onfullpage = function (width, height) { stackedNotify(true, width, height); };
- $('{id}').onrestore = function () { stackedNotify(false, {width}, 100); };
+ $('{id}').onfullpage = function (width, height) { stackedNotify(true, width, height, '{id}'); };
+ $('{id}').onrestore = function () { stackedNotify(false, {width}, 100, '{id}'); };
var oImg = document.images['{id}'];
$(oImg).addEvent('load', function () { this.style.visibility = "visible" });
$(oImg).addEvent('dblclick', function () {fullpage(this.parentNode.parentNode.parentNode.getElementsByTagName('p')[0])});
+}())
//]]>
</script>
Modified: mgmt/trunk/cumin/python/cumin/visualizations.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/visualizations.strings 2009-04-20 14:14:01 UTC (rev 3310)
+++ mgmt/trunk/cumin/python/cumin/visualizations.strings 2009-04-20 18:53:04 UTC (rev 3311)
@@ -235,10 +235,10 @@
var oZooming = document.getElementById("slot_zooming");
if (oZooming) {
oZooming.style.display = "block";
- var oMap = document.getElementById(slot_current_id);
- if (oMap) {
- oZooming.style.width = oMap.offsetWidth + "px";
- }
+ //var oMap = document.getElementById(slot_current_id);
+ //if (oMap) {
+ // oZooming.style.width = oMap.offsetWidth + "px";
+ //}
}
var oImg = document.images[slot_current_id];
if (oImg) {
@@ -826,11 +826,13 @@
}
div#slot_zooming {
- width: 400px;
+/* width: 400px;
height: 400px;
position: absolute;
left:0;
- top:0;
+ top:0; */
+ margin: 3em auto;
+ padding: 1em;
z-index:200;
text-align: center;
background-color: white;
@@ -838,11 +840,12 @@
opacity: 0.5;
-moz-opacity: 0.5;
display: none;
+ border: 1px solid #000;
}
div#slot_zooming p {
margin: 0;
- padding: 140px 0 0 0;
+/* padding: 140px 0 0 0; */
}
div#slot_controls {
More information about the rhmessaging-commits
mailing list