rhmessaging commits: r3009 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-12-16 14:47:55 -0500 (Tue, 16 Dec 2008)
New Revision: 3009
Modified:
mgmt/trunk/cumin/python/cumin/model.py
mgmt/trunk/cumin/python/cumin/system.py
mgmt/trunk/cumin/python/cumin/system.strings
Log:
Added sysimage statistics table.
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-12-16 19:46:53 UTC (rev 3008)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-12-16 19:47:55 UTC (rev 3009)
@@ -606,7 +606,7 @@
("Vacating", "orange"),
("Killing", "blue"),
("Benchmarking", "yellow"),
- ("Unknown", "black")]
+ ("Unknown", "grey")]
def get_field_tuples(self, session):
return [("name", "Name"), ("machine", "Machine"), ("job_id", "Job")]
@@ -619,7 +619,7 @@
for status, color in self.load_colors:
if status == activity:
return color
- return "black"
+ return "grey"
def get_colors(self):
return self.load_colors
@@ -648,13 +648,28 @@
prop.title = "Architecture"
stat = CuminStat(self, "memFree")
- stat.title = "Free Memory"
+ stat.title = "Memory Free"
stat.highlow = True
- stat = CuminStat(self, "loadAverage1Min")
+ stat = CuminStat(self, "swapFree")
+ stat.title = "Swap Free"
+
+ stat = self.LoadStat(self, "loadAverage1Min")
stat.title = "1 Minute Load Average"
stat.highlow = True
+ stat = self.LoadStat(self, "loadAverage5Min")
+ stat.title = "5 Minute Load Average"
+
+ stat = self.LoadStat(self, "loadAverage10Min")
+ stat.title = "10 Minute Load Average"
+
+ stat = CuminStat(self, "procTotal")
+ stat.title = "Total processes"
+
+ stat = CuminStat(self, "procRunning")
+ stat.title = "Running processes"
+
action = self.SystemSlotVisualization(self, "slots")
action.navigable = False
@@ -674,6 +689,10 @@
def get_object_name(self, object):
return object.nodeName
+ class LoadStat(CuminStat):
+ def value_text(self, object):
+ return "%0.2f" % self.value(object)
+
class SystemSlotVisualization(SlotVisualization):
def __init__(self, cls, name):
super(CuminSystem.SystemSlotVisualization, self).__init__(cls, name)
@@ -2109,7 +2128,7 @@
for i in range(len(percents)):
if work <= percents[i]:
return self.load_colors[i][1]
- return "black"
+ return "grey"
def get_colors(self):
return self.load_colors
Modified: mgmt/trunk/cumin/python/cumin/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.py 2008-12-16 19:46:53 UTC (rev 3008)
+++ mgmt/trunk/cumin/python/cumin/system.py 2008-12-16 19:47:55 UTC (rev 3009)
@@ -118,6 +118,8 @@
self.grid = self.SlotUtilizationGrid(app, "slot_grid")
self.add_child(self.grid)
+
+ self.add_child(StatSet(app, "stats", "general"))
chart = StatValueChart(app, "freemem")
chart.stats = ("memFree",)
@@ -189,6 +191,10 @@
self.__tabs.add_tab(SystemServices(app, "services"))
self.__tabs.add_tab(CuminDetails(app, "details"))
+ def render_script(self, session, system):
+ data = "model.xml?class=system;id=%i" % system.id
+ return "wooly.setIntervalUpdate('%s', updateSystem, 3000)" % data
+
from job import JobTab
class SystemJobSet(JobTab):
Modified: mgmt/trunk/cumin/python/cumin/system.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.strings 2008-12-16 19:46:53 UTC (rev 3008)
+++ mgmt/trunk/cumin/python/cumin/system.strings 2008-12-16 19:47:55 UTC (rev 3009)
@@ -88,6 +88,9 @@
<tbody>
<tr>
<td>
+ <h2>Memory/Load</h2>
+ {stats}
+
{slot_grid}
</td>
<td>
@@ -101,7 +104,22 @@
var show_slot_job_url = "{slot_job_url}";
</script>
+[SystemView.javascript]
+function updateSystem(data) {
+ var model = data.objectify();
+ var systems = model.system;
+ var system;
+ for (var key in systems) {
+ system = systems[key];
+ break;
+ }
+
+ cumin.runModelListeners(model);
+ cumin.runObjectListeners(system);
+}
+
+
[SystemJobSet.html]
<div class="rfloat">{phase}</div>
<form id="{id}" style="clear:right;" method="post" action="?">