Author: eallen
Date: 2011-04-05 19:21:56 +0000 (Tue, 05 Apr 2011)
New Revision: 4687
Modified:
trunk/cumin/python/cumin/grid/scheduler.py
trunk/cumin/python/cumin/grid/scheduler.strings
Log:
Add the new stats and a boat load of charts to scheduler
Modified: trunk/cumin/python/cumin/grid/scheduler.py
===================================================================
--- trunk/cumin/python/cumin/grid/scheduler.py 2011-04-05 18:44:20 UTC (rev 4686)
+++ trunk/cumin/python/cumin/grid/scheduler.py 2011-04-05 19:21:56 UTC (rev 4687)
@@ -1,23 +1,16 @@
-from wooly import *
-from wooly.widgets import *
-from wooly.forms import *
-from wooly.resources import *
-from wooly.tables import *
+import logging
-from cumin.objectframe import *
-from cumin.objectselector import *
-from cumin.formats import *
-from cumin.model import *
-from cumin.parameters import *
+from wooly import Widget
+from wooly.util import StringCatalog
+from wooly.widgets import RadioModeSet, WidgetSet
+
from cumin.stat import *
-from cumin.util import *
-from cumin.widgets import *
+from cumin.objectframe import ObjectFrame
+from submitter import SubmitterFrame, SubmitterSelector
+from submission import PoolSubmissionSelector
+from cumin.objectselector import ObjectSelectorTable, ObjectSelector,\
+ ObjectLinkColumn, MonitorSelfStatColumn, ObjectTable
-from daemon import *
-from job import *
-from submitter import *
-from submission import *
-
strings = StringCatalog(__file__)
log = logging.getLogger("cumin.grid.scheduler")
@@ -108,6 +101,16 @@
# avoid the checkboxes
return ObjectTable(app, name, cls)
+class SchedulerOverview(RadioModeSet):
+ def __init__(self, app, name, scheduler):
+ super(SchedulerOverview, self).__init__(app, name)
+
+ self.add_tab(SchedulerOverviewGeneral(app, "general", scheduler))
+ self.add_tab(SchedulerOverviewCycle(app, "cycle", scheduler))
+
+ def render_title(self, session):
+ return "Overview"
+
class SchedulerGeneralStatSet(StatSet):
def __init__(self, app, name, object):
super(SchedulerGeneralStatSet, self).__init__(app, name, object)
@@ -119,9 +122,9 @@
"MonitorSelfImageSize","MonitorSelfRegisteredSocketCount",
"MonitorSelfResidentSetSize","MonitorSelfTime")
-class SchedulerOverview(Widget):
+class SchedulerOverviewGeneral(Widget):
def __init__(self, app, name, scheduler):
- super(SchedulerOverview, self).__init__(app, name)
+ super(SchedulerOverviewGeneral, self).__init__(app, name)
stats = SchedulerGeneralStatSet(app, "general", scheduler)
self.add_child(stats)
@@ -137,7 +140,7 @@
self.add_child(chart)
def render_title(self, session):
- return "Overview"
+ return "General stats"
class UsersChart(StatFlashChart):
def render_title(self, session):
@@ -146,3 +149,68 @@
class JobsChart(StatFlashChart):
def render_title(self, session):
return "Jobs"
+
+class SchedulerOverviewCycle(Widget):
+ def __init__(self, app, name, scheduler):
+ super(SchedulerOverviewCycle, self).__init__(app, name)
+
+ stats = StatSet(app, "stats", scheduler)
+ stats.attrs = ("JobsStarted", "JobStartRate",
"JobsStartedCum",
+ "JobsSubmitted", "JobSubmissionRate",
"JobsSubmittedCum",
+ "JobsCompleted", "JobCompletionRate",
"JobsCompletedCum",
+ "JobsExited", "JobsExitedCum",
+ "ShadowExceptions", "ShadowExceptionsCum",
+ "MeanTimeToStart", "MeanTimeToStartCum",
"SumTimeToStartCum",
+ "MeanRunningTime", "MeanRunningTimeCum",
"SumRunningTimeCum")
+ self.add_child(stats)
+
+ charts = WidgetSet(app, "charts")
+ self.add_child(charts)
+
+ chart = self.TitledChart(app, "submitted", scheduler)
+ chart.title = "Submitted"
+ chart.stats = ("JobsSubmitted", "JobSubmissionRate",
"JobsSubmittedCum")
+ charts.add_child(chart)
+
+ chart = self.TitledChart(app, "started", scheduler)
+ chart.title = "Started"
+ chart.stats = ("JobsStarted", "JobStartRate",
"JobsStartedCum")
+ charts.add_child(chart)
+
+ chart = self.TitledChart(app, "completed", scheduler)
+ chart.title = "Completed"
+ chart.stats = ("JobsCompleted", "JobCompletionRate",
"JobsCompletedCum")
+ charts.add_child(chart)
+
+ chart = self.TitledChart(app, "exited", scheduler)
+ chart.title = "Exited"
+ chart.stats = ("JobsExited", "JobsExitedCum")
+ charts.add_child(chart)
+
+ chart = self.TitledChart(app, "exception", scheduler)
+ chart.title = "Shadow exceptions"
+ chart.stats = ("ShadowExceptions", "ShadowExceptionsCum")
+ charts.add_child(chart)
+
+ chart = self.TitledChart(app, "start_time", scheduler)
+ chart.title = "Mean start times"
+ chart.stats = ("MeanTimeToStart", "MeanTimeToStartCum",
"SumTimeToStartCum")
+ charts.add_child(chart)
+
+ chart = self.TitledChart(app, "running_time", scheduler)
+ chart.title = "Mean running times"
+ chart.stats = ("MeanRunningTime", "MeanRunningTimeCum",
"SumRunningTimeCum")
+ charts.add_child(chart)
+
+ def render_title(self, session):
+ return "Job start stats"
+
+ class TitledChart(StatFlashChart):
+ def __init__(self, app, name, scheduler):
+ super(SchedulerOverviewCycle.TitledChart, self).__init__(app, name,
scheduler)
+
+ self.title = None
+ self.duration.param.default = "3600"
+
+ def render_title(self, session):
+ return self.title
Modified: trunk/cumin/python/cumin/grid/scheduler.strings
===================================================================
--- trunk/cumin/python/cumin/grid/scheduler.strings 2011-04-05 18:44:20 UTC (rev 4686)
+++ trunk/cumin/python/cumin/grid/scheduler.strings 2011-04-05 19:21:56 UTC (rev 4687)
@@ -1,9 +1,8 @@
-[SchedulerOverview.html]
+[SchedulerOverviewGeneral.html]
<table class="twocol">
<tbody>
<tr>
<td>
- <h2>General</h2>
{general}
</td>
<td>
@@ -13,3 +12,29 @@
</tr>
</tbody>
</table>
+
+[SchedulerOverviewCycle.css]
+table.SchedulerOverviewCycle ul.WidgetSet {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+}
+
+table.SchedulerOverviewCycle ul.WidgetSet li {
+ display: inline;
+}
+
+[SchedulerOverviewCycle.html]
+<table class="SchedulerOverviewCycle twocol">
+ <tbody>
+ <tr>
+ <td>
+ {stats}
+ </td>
+ <td>
+ {charts}
+ </td>
+ </tr>
+ </tbody>
+</table>
+