Author: eallen
Date: 2009-04-29 14:49:35 -0400 (Wed, 29 Apr 2009)
New Revision: 3346
Modified:
mgmt/trunk/cumin/python/cumin/grid/slot.py
mgmt/trunk/cumin/python/cumin/grid/slot.strings
Log:
Added some columns to SlotSet.
Added Slot tab to Pool view.
Modified: mgmt/trunk/cumin/python/cumin/grid/slot.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/slot.py 2009-04-29 18:48:43 UTC (rev 3345)
+++ mgmt/trunk/cumin/python/cumin/grid/slot.py 2009-04-29 18:49:35 UTC (rev 3346)
@@ -32,6 +32,18 @@
col = self.NameColumn(app, "name")
self.add_column(col)
+ col = self.ActivityColumn(app, "activity")
+ self.add_column(col)
+
+ col = self.StateColumn(app, "state")
+ self.add_column(col)
+
+ col = self.LoadAvgColumn(app, "load_avg")
+ self.add_column(col)
+
+ col = self.JobColumn(app, "jid")
+ self.add_column(col)
+
class NameColumn(SqlTableColumn):
def render_title(self, session, data):
return "Name"
@@ -41,6 +53,35 @@
href = self.frame.slot.get_href(session, slot)
return fmt_link(href, data["name"])
+ class ActivityColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Activity"
+
+ class StateColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "State"
+
+ class StateColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "State"
+
+ class LoadAvgColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Load"
+
+ def render_value(self, session, value):
+ return "%2.02f" % value
+
+ class JobColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Current Job"
+
+ def render_content(self, session, data):
+ if data["jid"]:
+ job = Identifiable(data["jid"])
+ href = self.page.main.grid.job.get_href(session, job)
+ return fmt_link(href, data["job_id"])
+
def render_items(self, session, *args):
""" overridden because a slotset query is expensive.
the rows are cached """
Modified: mgmt/trunk/cumin/python/cumin/grid/slot.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/slot.strings 2009-04-29 18:48:43 UTC (rev 3345)
+++ mgmt/trunk/cumin/python/cumin/grid/slot.strings 2009-04-29 18:49:35 UTC (rev 3346)
@@ -7,7 +7,8 @@
s.job_id,
j.id as jid,
c.activity,
- c.state
+ c.state,
+ c.load_avg
from slot as s
left outer join slot_stats as c on c.id = s.stats_curr_id
left outer join job as j on j.custom_id = s.job_id