Author: eallen
Date: 2011-03-23 12:48:16 +0000 (Wed, 23 Mar 2011)
New Revision: 4657
Modified:
trunk/cumin/python/cumin/grid/dashboard.py
trunk/cumin/python/cumin/grid/pool.py
trunk/cumin/python/cumin/grid/slot.py
trunk/cumin/python/cumin/grid/slotvis.py
Log:
Move slot visualization to the Slot tab.
Add a radiomodeset to the Slot tab to display the Slot table and the Slot vis.
Modified: trunk/cumin/python/cumin/grid/dashboard.py
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.py 2011-03-22 19:09:02 UTC (rev 4656)
+++ trunk/cumin/python/cumin/grid/dashboard.py 2011-03-23 12:48:16 UTC (rev 4657)
@@ -13,9 +13,7 @@
ObjectLinkColumn, CsvStatsExporter, ExportButton
from cumin.util import rgb_to_string
from negotiator import NegotiatorAttribute
-from cumin.grid.slotvis import PoolSlotMap, PoolSlotFlashVis
from wooly.template import WidgetTemplate
-from cumin.formats import fmt_bytes
strings = StringCatalog(__file__)
log = logging.getLogger("cumin.dashboard")
@@ -35,27 +33,9 @@
capacity = DashboardCapacity(app, "c", collector)
self.add_tab(capacity)
- visualization = Visualization(app, "v", collector)
- self.add_tab(visualization)
-
def render_title(self, session):
return "Overview"
-class Visualization(Widget):
- def __init__(self, app, name, collector):
- super(Visualization, self).__init__(app, name)
-
- self.collector = collector
-
- slot_map = PoolSlotMap(app, "slot_png", self.collector)
- self.add_child(slot_map)
-
- slot_vis = PoolSlotFlashVis(app, "slot_map", self.collector)
- self.add_child(slot_vis)
-
- def render_title(self, session):
- return "Slot visualization"
-
class Dashboard(WidgetSet):
def __init__(self, app, name, collector):
super(Dashboard, self).__init__(app, name)
Modified: trunk/cumin/python/cumin/grid/pool.py
===================================================================
--- trunk/cumin/python/cumin/grid/pool.py 2011-03-22 19:09:02 UTC (rev 4656)
+++ trunk/cumin/python/cumin/grid/pool.py 2011-03-23 12:48:16 UTC (rev 4657)
@@ -10,13 +10,14 @@
from cumin.grid.dashboard import PoolDashboard
from submission import SubmissionFrame, PoolSubmissionJoinSelector
-from slot import SlotFrame, SlotSelector
+from slot import SlotFrame
from scheduler import SchedulerFrame, SchedulerSelector
from negotiator import NegotiatorFrame, NegotiatorSelector,\
NegotiatorEditDynamicQuota, NegotiatorAttribute
from limit import LimitFrame, LimitSelector
-from cumin.grid.quota import QuotaSelector
+from cumin.grid.quota import QuotaSelector
from collector import CollectorGeneralStatSet
+from cumin.grid.slotvis import SlotOverview
strings = StringCatalog(__file__)
log = logging.getLogger("cumin.pool")
@@ -71,16 +72,13 @@
self.limit = LimitFrame(app, "limit")
self.add_mode(self.limit)
- #overview = PoolOverview(app, "overview", self.object)
- #self.view.add_tab(overview)
-
dashboard = PoolDashboard(app, "dashboard", self.object)
self.view.add_tab(dashboard)
submissions = PoolSubmissionJoinSelector(app, "pool_submissions",
self.object)
self.view.add_tab(submissions)
- slots = SlotSelector(app, "slots", self.object)
+ slots = SlotOverview(app, "slots", self.object)
self.view.add_tab(slots)
schedulers = SchedulerSelector(app, "schedulers", self.object)
Modified: trunk/cumin/python/cumin/grid/slot.py
===================================================================
--- trunk/cumin/python/cumin/grid/slot.py 2011-03-22 19:09:02 UTC (rev 4656)
+++ trunk/cumin/python/cumin/grid/slot.py 2011-03-23 12:48:16 UTC (rev 4657)
@@ -14,36 +14,6 @@
strings = StringCatalog(__file__)
log = logging.getLogger("cumin.slot")
-class SlotSelector(ObjectSelector):
- def __init__(self, app, name, pool):
- cls = app.model.com_redhat_grid.Slot
-
- super(SlotSelector, self).__init__(app, name, cls)
-
- self.pool = pool
-
- self.add_filter(self.pool, cls.Pool, cls.Pool)
-
- frame = "main.grid.slot"
- col = ObjectLinkColumn(app, "name", cls.Name, cls._id, frame)
- self.add_column(col)
- self.add_search_filter(col)
-
- self.add_attribute_column(cls.Activity)
- self.add_attribute_column(cls.State)
-
- col = ObjectTableColumn(app, cls.LoadAvg.name, cls.LoadAvg)
- self.add_column(col)
- # sort by load average descending
- self.table.sort.default = col.name
- self.table.ascending.default = False
-
- self.enable_csv_export(pool)
-
- def create_table(self, app, name, cls):
- # avoid the checkboxes
- return ObjectTable(app, name, cls)
-
class SlotFrame(ObjectFrame):
def __init__(self, app, name):
cls = app.model.com_redhat_grid.Slot
Modified: trunk/cumin/python/cumin/grid/slotvis.py
===================================================================
--- trunk/cumin/python/cumin/grid/slotvis.py 2011-03-22 19:09:02 UTC (rev 4656)
+++ trunk/cumin/python/cumin/grid/slotvis.py 2011-03-23 12:48:16 UTC (rev 4657)
@@ -1,14 +1,79 @@
import logging
+
+from wooly import Session, Widget
from wooly.util import StringCatalog
+from wooly.widgets import RadioModeSet
+
from slot import SlotMap, SlotMapPage
-from wooly import Session
from cumin.parameters import RosemaryObjectParameter
from cumin.widgets import StateSwitch
from cumin.stat import FlashFullPage
+from cumin.objectselector import ObjectSelector, ObjectLinkColumn,\
+ ObjectTableColumn, ObjectTable
strings = StringCatalog(__file__)
log = logging.getLogger("cumin.slotvis")
+class SlotOverview(RadioModeSet):
+ def __init__(self, app, name, pool):
+ super(SlotOverview, self).__init__(app, name)
+
+ self.pool = pool
+
+ self.add_tab(SlotSelector(app, "slots", pool))
+ self.add_tab(Visualization(app, "vis", pool))
+
+ def render_title(self, session):
+ return "Slots"
+
+class SlotSelector(ObjectSelector):
+ def __init__(self, app, name, pool):
+ cls = app.model.com_redhat_grid.Slot
+
+ super(SlotSelector, self).__init__(app, name, cls)
+
+ self.pool = pool
+
+ self.add_filter(self.pool, cls.Pool, cls.Pool)
+
+ frame = "main.grid.slot"
+ col = ObjectLinkColumn(app, "name", cls.Name, cls._id, frame)
+ self.add_column(col)
+ self.add_search_filter(col)
+
+ self.add_attribute_column(cls.Activity)
+ self.add_attribute_column(cls.State)
+
+ col = ObjectTableColumn(app, cls.LoadAvg.name, cls.LoadAvg)
+ self.add_column(col)
+ # sort by load average descending
+ self.table.sort.default = col.name
+ self.table.ascending.default = False
+
+ self.enable_csv_export(pool)
+
+ def create_table(self, app, name, cls):
+ # avoid the checkboxes
+ return ObjectTable(app, name, cls)
+
+ def render_title(self, session):
+ return "Slot table"
+
+class Visualization(Widget):
+ def __init__(self, app, name, collector):
+ super(Visualization, self).__init__(app, name)
+
+ self.collector = collector
+
+ slot_map = PoolSlotMap(app, "slot_png", self.collector)
+ self.add_child(slot_map)
+
+ slot_vis = PoolSlotFlashVis(app, "slot_map", self.collector)
+ self.add_child(slot_vis)
+
+ def render_title(self, session):
+ return "Slot visualization"
+
class PoolSlotMap(SlotMap):
def __init__(self, app, name, collector):
super(PoolSlotMap, self).__init__(app, name)
@@ -144,3 +209,4 @@
def render_content(self, session):
return self.flash_chart.render(session)
+