rhmessaging commits: r2712 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-31 10:16:57 -0400 (Fri, 31 Oct 2008)
New Revision: 2712
Modified:
mgmt/trunk/cumin/python/cumin/stat.py
Log:
Adding default href for grid widget
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2008-10-31 13:58:02 UTC (rev 2711)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2008-10-31 14:16:57 UTC (rev 2712)
@@ -199,6 +199,9 @@
else:
return 100
+ def render_href(self, session, count, object):
+ return "#"
+
def render_color(self, session, count, object):
return "clear"
16 years, 2 months
rhmessaging commits: r2711 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-31 09:58:02 -0400 (Fri, 31 Oct 2008)
New Revision: 2711
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Remove time contraint on job grid widget
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-10-30 22:53:28 UTC (rev 2710)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-10-31 13:58:02 UTC (rev 2711)
@@ -1834,7 +1834,7 @@
def get_jobs(self, pool):
elems = list()
- elems.append("job.rec_time > now() - interval '90 minutes'")
+ #elems.append("job.rec_time > now() - interval '90 minutes'")
#elems.append("job.deletion_time is null and job_status != %i" % JobStatusInfo.get_status_int("Removed"))
elems.append("s.pool = '%s'" % pool.id)
sql = " and ".join(elems)
16 years, 2 months
rhmessaging commits: r2710 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-30 18:53:28 -0400 (Thu, 30 Oct 2008)
New Revision: 2710
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
Force IE to re-get the ajax request to update the grid widget.
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-10-30 21:04:47 UTC (rev 2709)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-10-30 22:53:28 UTC (rev 2710)
@@ -1163,7 +1163,8 @@
script = """
<script type="text/javascript">
function get_%s() {
- wooly.deferredUpdate('%s', got_%s, "%s");
+ var now = new Date();
+ wooly.deferredUpdate('%s'+';ts='+now.getTime(), got_%s, "%s");
}
addEvent(window, "load", get_%s);
</script>
16 years, 2 months
rhmessaging commits: r2709 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-30 17:04:47 -0400 (Thu, 30 Oct 2008)
New Revision: 2709
Modified:
mgmt/trunk/cumin/python/cumin/job.py
mgmt/trunk/cumin/python/cumin/job.strings
Log:
Fix Job search. It was missing support for the new pool SQL.
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-10-30 21:03:57 UTC (rev 2708)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-10-30 21:04:47 UTC (rev 2709)
@@ -232,8 +232,8 @@
def render_find_sql_where(self, session, *args):
return "j.custom_id = %(custom_id)s"
- def get_find_sql_values(self, session, *args):
- return {"custom_id": self.job_search.get(session)}
+ def get_find_sql_values(self, session, pool):
+ return {"custom_id": self.job_search.get(session), "pool": pool.id}
def get_visible_columns(self, session):
return self.get_request_visible_columns(session, ["custom_group", "scheduler", "submitter"])
Modified: mgmt/trunk/cumin/python/cumin/job.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.strings 2008-10-30 21:03:57 UTC (rev 2708)
+++ mgmt/trunk/cumin/python/cumin/job.strings 2008-10-30 21:04:47 UTC (rev 2709)
@@ -31,6 +31,7 @@
from job as j
left outer join job_stats as c on c.id = j.stats_curr_id
left outer join job_stats as p on p.id = j.stats_prev_id
+inner join scheduler as s on s.id = j.scheduler_id
[JobSet.count_sql]
select count(1)
16 years, 2 months
rhmessaging commits: r2708 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-30 17:03:57 -0400 (Thu, 30 Oct 2008)
New Revision: 2708
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Handle situation when Master is not available (can't call Start/Stop)
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-10-30 19:49:47 UTC (rev 2707)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-10-30 21:03:57 UTC (rev 2708)
@@ -657,13 +657,19 @@
class Start(CuminAction):
def do_invoke(self, object, args, completion):
system_name = object.System
- master = Master.select("System = '%s'" % system_name)[0]
+ try:
+ master = Master.select("System = '%s'" % system_name)[0]
+ except IndexError:
+ raise Exception("Master daemon not running")
master.Start(self.model.data, completion, args["subsystem"])
class Stop(CuminAction):
def do_invoke(self, object, args, completion):
system_name = object.System
- master = Master.select("System = '%s'" % system_name)[0]
+ try:
+ master = Master.select("System = '%s'" % system_name)[0]
+ except IndexError:
+ raise Exception("Master daemon not running")
master.Stop(self.model.data, completion, args["subsystem"])
class CuminBroker(RemoteClass):
16 years, 2 months
rhmessaging commits: r2707 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-30 15:49:47 -0400 (Thu, 30 Oct 2008)
New Revision: 2707
Modified:
mgmt/trunk/cumin/python/cumin/pool.strings
mgmt/trunk/cumin/python/cumin/stat.strings
Log:
Ensure the grid popup doesn't extend past the right side of the page on Firefox and IE
Modified: mgmt/trunk/cumin/python/cumin/pool.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.strings 2008-10-30 00:23:51 UTC (rev 2706)
+++ mgmt/trunk/cumin/python/cumin/pool.strings 2008-10-30 19:49:47 UTC (rev 2707)
@@ -28,7 +28,7 @@
{general}
</div>
</div>
-<div style="width: 25%; float: left; margin-left: 4em;">
+<div style="float: left; margin-left: 4em;">
<h2>Job Activity</h2>
{job_grid}
</div>
Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings 2008-10-30 00:23:51 UTC (rev 2706)
+++ mgmt/trunk/cumin/python/cumin/stat.strings 2008-10-30 19:49:47 UTC (rev 2707)
@@ -165,6 +165,81 @@
<span class="ph" statname="{stat_name}" statmode="{mode}">{stat_value}</span>
</li>
+[StatUtilizationGrid.javascript]
+/* called on page resize to make sure
+ the grid popup notes don't go
+ off the edge of the page */
+function ensure_notes_visible() {
+ // see if the current rule will show the note off the page
+
+ this.find_rule = function() {
+ if (document.styleSheets) {
+ for (var i=0; i<document.styleSheets.length; i++) {
+ sheet = document.styleSheets[i];
+ if (sheet.href.indexOf("cumin.css") != -1) {
+ rules = sheet.rules ? sheet.rules : sheet.cssRules;
+ if (rules[0].selectorText) { // IE
+ for (var j=0; j<rules.length; j++) {
+ if (rules[j].selectorText.indexOf("sticky_note") != -1) {
+ if (rules[j].selectorText.indexOf("position") != -1) {
+ return rules[j];
+ }
+ }
+ }
+ } else {
+ for (var j=0; j<rules.length; j++) {
+ if (rules[j].cssText.indexOf("div.sticky_note.position") != -1) {
+ return rules[j];
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ this.get_left = function (o) {
+ var p = o.offsetParent;
+ var true_left = o.offsetLeft;
+
+ while (p != null) {
+ tag = p.tagName;
+ if (p.clientLeft) {
+ if ( (tag != "TABLE") && (tag != "BODY") ) {
+ true_left += p.clientLeft;
+ }
+ }
+ true_left += p.offsetLeft;
+ p = p.offsetParent;
+ }
+ return true_left;
+ }
+
+ var oGrid = document.getElementById("StatGrid");
+ if (oGrid) {
+ var left = this.get_left(oGrid);
+ var right = left + oGrid.offsetWidth;
+ var rule = this.find_rule();
+ if (rule) {
+ if (window.innerWidth)
+ wwidth = window.innerWidth;
+ else if (document.documentElement)
+ wwidth = document.documentElement.clientWidth;
+ else
+ wwidth = 9999;
+ if (right + 310 > wwidth) {
+ rule.style.left = "";
+ rule.style.right = "50%";
+ }
+ }
+ }
+
+
+}
+addEvent(window, "resize", ensure_notes_visible);
+addEvent(window, "load", ensure_notes_visible);
+
[StatUtilizationGrid.css]
div.StatGrid{
width: 10em;
@@ -199,10 +274,10 @@
div.grid_cell div.sticky_note {
display: none;
+ font-size: 0.8em;
position: absolute;
- top: 60%;
- left: 100%;
- width: 24em;
+ top: 120%;
+ width: 25em;
padding: 1em;
background-color: #ffffaa;
background-image: url(resource?name=shade.png);
@@ -211,6 +286,12 @@
border: 1px solid #cccc99;
z-index: 1;
}
+/* this rule is separated in order to make it easier
+ to change only this attribute in the onresize handler */
+div.grid_cell div.sticky_note.position {
+ left: 50%;
+}
+
div.sticky_names {
float: left;
font-weight: bold;
@@ -235,7 +316,7 @@
<div class="StatUtilizationGrid" id="{id}">
<div class="visualization">
<h2>{title}</h2>
- <div class="StatGrid" {override_style}>
+ <div id="StatGrid" class="StatGrid" {override_style}>
{grid}
</div>
<div style="clear:left;"><!-- --></div>
@@ -256,7 +337,7 @@
onmouseover="document.getElementById('note_{cell_id}').style.display='block';"
onmouseout="document.getElementById('note_{cell_id}').style.display='none';">
<a href="#"><button id="button_{cell_id}" class="btn {color}" >{contents}</button></a>
- <div id="note_{cell_id}" class="sticky_note">
+ <div id="note_{cell_id}" class="sticky_note position">
<div class="sticky_names">
{sticky_names}
</div>
16 years, 2 months
rhmessaging commits: r2706 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-29 20:23:51 -0400 (Wed, 29 Oct 2008)
New Revision: 2706
Modified:
mgmt/trunk/cumin/python/cumin/pool.py
Log:
Compensate for manually removed jobs not getting a status update.
Modified: mgmt/trunk/cumin/python/cumin/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.py 2008-10-30 00:22:35 UTC (rev 2705)
+++ mgmt/trunk/cumin/python/cumin/pool.py 2008-10-30 00:23:51 UTC (rev 2706)
@@ -330,20 +330,38 @@
return self.jobs.get(session)
else:
state = stat.name
- value = self.get_value(state)
+ value = self.get_value(session, state)
return value
- def get_value(self, state):
- where = "job_status = %i" % JobStatusInfo.get_status_int(state)
- return Job.select(where).count()
+ def get_value(self, session, state):
+ pool = self.frame.get_object(session)
+ elems = list()
+ istate = JobStatusInfo.get_status_int(state)
+ elems.append("job_status = %i" % istate)
+ elems.append("s.pool = '%s'" % pool.id)
+ # manually removed jobs will have a state of Idle
+ # with a deletion_time
+ if state == "Idle":
+ elems.append("job.deletion_time is null")
+ where = " and ".join(elems)
+
+ # manually removed jobs will have a state of Idle
+ # with a deletion_time
+ if state == "Removed":
+ removed = "(job.deletion_time is not null and job_status = %i)" % JobStatusInfo.get_status_int("Idle")
+ where = " or ".join((where, removed))
+
+ jn = "inner join scheduler as s on s.id = scheduler_id"
+ return Job.select(where, join=jn).count()
+
def render_item_rate(self, session, stat):
jobs = self.jobs.get(session)
state = stat[0].name
if state == "Jobs":
value = jobs
else:
- value = self.get_value(state)
+ value = self.get_value(session, state)
if jobs:
percent = (value*1.0) / (jobs*1.0) * 100.0
return jobs and "%2.2f" % percent or "-"
16 years, 2 months
rhmessaging commits: r2705 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-29 20:22:35 -0400 (Wed, 29 Oct 2008)
New Revision: 2705
Modified:
mgmt/trunk/cumin/python/cumin/system.py
Log:
Derive SystemJobSet from JobTab to pick up extra features
Modified: mgmt/trunk/cumin/python/cumin/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.py 2008-10-30 00:21:44 UTC (rev 2704)
+++ mgmt/trunk/cumin/python/cumin/system.py 2008-10-30 00:22:35 UTC (rev 2705)
@@ -118,9 +118,9 @@
self.__tabs.add_tab(SystemSlotSet(app, "slots"))
self.__tabs.add_tab(CuminDetails(app, "details"))
-from job import JobSet
+from job import JobTab
-class SystemJobSet(JobSet):
+class SystemJobSet(JobTab):
def render_title(self, session, *args):
sql = "1 = 1" # XXX
return "Grid Jobs %s" % fmt_count(Job.select(sql).count())
16 years, 2 months
rhmessaging commits: r2704 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-29 20:21:44 -0400 (Wed, 29 Oct 2008)
New Revision: 2704
Modified:
mgmt/trunk/cumin/python/cumin/job.py
Log:
Moved sql generation to base class
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-10-30 00:12:33 UTC (rev 2703)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-10-30 00:21:44 UTC (rev 2704)
@@ -87,6 +87,15 @@
state = self.phase.get(session)
return self.phase.get_title(state)
+ def render_sql_where(self, session, *args):
+ elems = list()
+ elems.append(self.get_phase_sql(session))
+ elems.append("s.pool = %(pool)s")
+ return "where %s" % " and ".join(elems)
+
+ def get_sql_values(self, session, pool):
+ return {"pool": pool.id}
+
class ArgsColumn(SqlTableColumn):
def render_title(self, session, data):
return "Arguments"
@@ -229,15 +238,6 @@
def get_visible_columns(self, session):
return self.get_request_visible_columns(session, ["custom_group", "scheduler", "submitter"])
- def render_sql_where(self, session, *args):
- elems = list()
- elems.append(self.get_phase_sql(session))
- elems.append("s.pool = %(pool)s")
- return "where %s" % " and ".join(elems)
-
- def get_sql_values(self, session, pool):
- return {"pool": pool.id}
-
def render_count(self, session, *args):
count = self.get_item_count(session, *args)
phase = self.get_phase_title(session)
16 years, 2 months
rhmessaging commits: r2703 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-10-29 20:12:33 -0400 (Wed, 29 Oct 2008)
New Revision: 2703
Modified:
mgmt/trunk/cumin/python/cumin/job.py
Log:
Added a completed state to the JobSet phases
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-10-29 20:30:27 UTC (rev 2702)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-10-30 00:12:33 UTC (rev 2703)
@@ -1229,6 +1229,7 @@
self.add_state("r", "Running")
self.add_state("i", "Idle")
self.add_state("h", "Held")
+ self.add_state("c", "Completed")
self.add_state("d", "Removed")
def get_sql_constraint(self, session):
@@ -1249,8 +1250,15 @@
elif phase == "h":
sql = "(j.job_status = %i" % JobStatusInfo.get_status_int("Held") + \
" and %s)" % alive
+ elif phase == "c":
+ comotose = "(c.rec_time is null or " + \
+ "c.rec_time <= now() - interval '10 minutes')"
+ sql = "(j.job_status = %i" % JobStatusInfo.get_status_int("Completed") + \
+ " and %s)" % comotose
else:
- sql = "j.deletion_time is not null or j.job_status = %i" % JobStatusInfo.get_status_int("Removed")
+ not_completed = "(j.deletion_time is not null and j.job_status <> %i )" % JobStatusInfo.get_status_int("Completed")
+ is_removed = "j.job_status = %i" % JobStatusInfo.get_status_int("Removed")
+ sql = " or ".join((not_completed, is_removed))
return sql
16 years, 2 months