Author: eallen
Date: 2009-11-09 16:03:12 -0500 (Mon, 09 Nov 2009)
New Revision: 3706
Modified:
mgmt/trunk/cumin/python/cumin/grid/job.py
mgmt/trunk/cumin/python/cumin/grid/job.strings
mgmt/trunk/cumin/python/cumin/grid/submission.py
mgmt/trunk/cumin/python/cumin/grid/submission.strings
mgmt/trunk/cumin/python/cumin/main.py
mgmt/trunk/cumin/python/cumin/main.strings
Log:
Changed from Top Jobs to Top Submissions.
Modified: mgmt/trunk/cumin/python/cumin/grid/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/job.py 2009-11-09 20:52:45 UTC (rev 3705)
+++ mgmt/trunk/cumin/python/cumin/grid/job.py 2009-11-09 21:03:12 UTC (rev 3706)
@@ -127,43 +127,6 @@
def get(self, session):
return (self.job.get(session), self.submission.get(session))
-class TopJobSet(TopTable):
- def __init__(self, app, name):
- super(TopJobSet, self).__init__(app, name)
-
- col = self.NameColumn(app, "name")
- col.width = "60%"
- self.add_column(col)
-
- self.set_default_column(col)
-
- col = self.DurationColumn(app, "name")
- col.width = "35%"
- col.align = "right"
- self.add_column(col)
-
- class NameColumn(TopTableColumn):
- def render_title(self, session, data):
- return "Name"
-
- def render_content(self, session, data):
- pool = Identifiable(data["pool"])
- job = Identifiable(data["id"])
-
- branch = session.branch()
- self.page.main.grid.pool.object.set(session, pool)
- self.page.main.grid.pool.job.object.set(session, job)
- self.page.main.grid.pool.job.show(session)
- return fmt_link(branch.marshal(), data["name"],
link_title=data["name"])
-
- class DurationColumn(TopTableColumn):
- def render_title(self, session, data):
- return "Duration"
-
- def render_content(self, session, data):
- since = data["q_date"]
- return fmt_duration(time() - secs(since))
-
class JobTab(JobSet):
def __init__(self, app, name, pool):
super(JobTab, self).__init__(app, name, pool)
Modified: mgmt/trunk/cumin/python/cumin/grid/job.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/job.strings 2009-11-09 20:52:45 UTC (rev 3705)
+++ mgmt/trunk/cumin/python/cumin/grid/job.strings 2009-11-09 21:03:12 UTC (rev 3706)
@@ -40,22 +40,6 @@
inner join submitter as b on b.id = j.submitter_id
{sql_where}
-[TopJobSet.sql]
-select
- j.id,
- j.custom_id as name,
- j.q_date,
- s.pool
-from job as j
-join scheduler s on s.id = j.scheduler_id
-where j.job_status = 2
- and j.qmf_update_time > now() - interval '60 seconds'
-order by j.q_date asc
-limit 5
-
-[TopJobSet.count_sql]
---
-
[JobTab.css]
input.search_input {
color: #555;
Modified: mgmt/trunk/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/submission.py 2009-11-09 20:52:45 UTC (rev 3705)
+++ mgmt/trunk/cumin/python/cumin/grid/submission.py 2009-11-09 21:03:12 UTC (rev 3706)
@@ -282,3 +282,41 @@
class AttributesField(MultilineStringField):
def render_title(self, session):
return "Extra attributes"
+
+class TopSubmissionSet(TopTable):
+ def __init__(self, app, name):
+ super(TopSubmissionSet, self).__init__(app, name)
+
+ col = self.NameColumn(app, "name")
+ col.width = "60%"
+ self.add_column(col)
+
+ self.set_default_column(col)
+
+ col = self.DurationColumn(app, "name")
+ col.width = "35%"
+ col.align = "right"
+ self.add_column(col)
+
+ class NameColumn(TopTableColumn):
+ def render_title(self, session, data):
+ return "Name"
+
+ def render_content(self, session, data):
+ pool = Identifiable(data["pool"])
+ submission = Identifiable(data["id"])
+
+ branch = session.branch()
+ self.page.main.grid.pool.object.set(session, pool)
+ self.page.main.grid.pool.submission.object.set(session, submission)
+ self.page.main.grid.pool.submission.show(session)
+ return fmt_link(branch.marshal(), data["name"],
link_title=data["name"])
+
+ class DurationColumn(TopTableColumn):
+ def render_title(self, session, data):
+ return "Duration"
+
+ def render_content(self, session, data):
+ since = data["qmf_create_time"]
+ return fmt_duration(time() - secs(since))
+
Modified: mgmt/trunk/cumin/python/cumin/grid/submission.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/submission.strings 2009-11-09 20:52:45 UTC (rev
3705)
+++ mgmt/trunk/cumin/python/cumin/grid/submission.strings 2009-11-09 21:03:12 UTC (rev
3706)
@@ -24,3 +24,21 @@
inner join submitter as m on s.submitter_id = m.id
inner join submission_stats as c on s.stats_curr_id = c.id
{sql_where}
+
+[TopSubmissionSet.sql]
+select
+ j.id,
+ j.name,
+ j.qmf_create_time,
+ s.pool
+from submission as j
+join scheduler s on s.id = j.scheduler_id
+left outer join submission_stats as ss on ss.id = j.stats_curr_id
+where ss.running > 0
+ and ss.qmf_update_time > now() - interval '60 seconds'
+order by j.qmf_create_time asc
+limit 5
+
+[TopSubmissionSet.count_sql]
+--
+
Modified: mgmt/trunk/cumin/python/cumin/main.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/main.py 2009-11-09 20:52:45 UTC (rev 3705)
+++ mgmt/trunk/cumin/python/cumin/main.py 2009-11-09 21:03:12 UTC (rev 3706)
@@ -140,8 +140,8 @@
queues = messaging.queue.TopQueueSet(app, "queues")
self.add_child(queues)
- jobs = grid.job.TopJobSet(app, "jobs")
- self.add_child(jobs)
+ submissions = grid.submission.TopSubmissionSet(app, "submissions")
+ self.add_child(submissions)
systems = inventory.system.TopSystemSet(app, "systems")
self.add_child(systems)
Modified: mgmt/trunk/cumin/python/cumin/main.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/main.strings 2009-11-09 20:52:45 UTC (rev 3705)
+++ mgmt/trunk/cumin/python/cumin/main.strings 2009-11-09 21:03:12 UTC (rev 3706)
@@ -13,6 +13,10 @@
margin: 0 0.2em 0 0;
}
+div.OverviewView {
+ clear: both;
+}
+
[OverviewView.html]
<div class="oblock OverviewView">
{notice}
@@ -29,8 +33,8 @@
</td>
<td>
<div class="fullpageable">
- <h2><img src="resource?name=job-20.png"/> Longest Running
Grid Jobs</h2>
- <div class="iblock">{jobs}</div>
+ <h2><img src="resource?name=job-20.png"/> Longest Running
Grid Submissions</h2>
+ <div class="iblock">{submissions}</div>
</div>
</td>
</tr>