r4705 - trunk/cumin/python/cumin/grid
by eallen@fedoraproject.org
Author: eallen
Date: 2011-04-12 16:46:45 +0000 (Tue, 12 Apr 2011)
New Revision: 4705
Modified:
trunk/cumin/python/cumin/grid/slot.py
Log:
Display slot vis groupings even if there is only one group
Modified: trunk/cumin/python/cumin/grid/slot.py
===================================================================
--- trunk/cumin/python/cumin/grid/slot.py 2011-04-12 13:57:51 UTC (rev 4704)
+++ trunk/cumin/python/cumin/grid/slot.py 2011-04-12 16:46:45 UTC (rev 4705)
@@ -131,7 +131,7 @@
max_png_age = 30
# start creating artificial groupings after the number of real groups
- max_top_level_items = 49
+ max_top_level_items = 500
def __init__(self, app, name, param, desc):
super(SlotMapPage, self).__init__(app, name)
@@ -408,14 +408,14 @@
for key in sorted(level_dict):
tree = list()
if not expanded:
- if len(level_dict) == 1:
- # there is only one grouping. no need to make them click on it
- tree = gen_leaves(level_dict[key]["plist"])
- add_branch(level_list, tree, False, group, key, len(level_dict[key]["plist"]))
- else:
- # display the top level of groups (artificial or notural)
- tree = gen_summary(level_dict[key]["plist"])
- add_branch(level_list, tree, False, group, key, len(level_dict[key]["plist"]))
+ #if len(level_dict) == 1:
+ # # there is only one grouping. no need to make them click on it
+ # tree = gen_leaves(level_dict[key]["plist"])
+ # add_branch(level_list, tree, False, group, key, len(level_dict[key]["plist"]))
+ #else:
+ # display the top level of groups (artificial or natural)
+ tree = gen_summary(level_dict[key]["plist"])
+ add_branch(level_list, tree, False, group, key, len(level_dict[key]["plist"]))
elif expanded == key:
# lowest level of a natural group
if key in original_level_dict:
13 years, 1 month
r4704 - trunk/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2011-04-12 13:57:51 +0000 (Tue, 12 Apr 2011)
New Revision: 4704
Modified:
trunk/cumin/python/cumin/widgets.py
Log:
Per BZ https://bugzilla.redhat.com/show_bug.cgi?id=679688 I have modified the string "Add Binding" to become "Add binding".
Modified: trunk/cumin/python/cumin/widgets.py
===================================================================
--- trunk/cumin/python/cumin/widgets.py 2011-04-12 12:45:28 UTC (rev 4703)
+++ trunk/cumin/python/cumin/widgets.py 2011-04-12 13:57:51 UTC (rev 4704)
@@ -1520,7 +1520,7 @@
class BindingAddTask(ObjectFrameTask):
def get_title(self, session):
- return "Add Binding"
+ return "Add binding"
def do_invoke(self, invoc, obj, queue, exchange, key, args):
session = self.app.model.get_session_by_object(obj)
13 years, 1 month
r4703 - trunk/cumin/python/cumin/grid
by eallen@fedoraproject.org
Author: eallen
Date: 2011-04-12 12:45:28 +0000 (Tue, 12 Apr 2011)
New Revision: 4703
Modified:
trunk/cumin/python/cumin/grid/dashboard.py
Log:
Add mouseover text to the slot breakdown by os table
Modified: trunk/cumin/python/cumin/grid/dashboard.py
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.py 2011-04-11 20:13:41 UTC (rev 4702)
+++ trunk/cumin/python/cumin/grid/dashboard.py 2011-04-12 12:45:28 UTC (rev 4703)
@@ -5,15 +5,17 @@
from wooly.datatable import DataAdapterOptions, DataAdapterField
from wooly.table import TableHeader
from wooly.widgets import RadioModeSet, WidgetSet
+from wooly.template import WidgetTemplate
+from parsley.stringex import rpartition
+from rosemary.sqlquery import SqlQueryOptions
+
from cumin.sqladapter import ObjectSqlAdapter
from cumin.stat import StatSet, PieChartPage, StatFlashChart
-from rosemary.sqlquery import SqlQueryOptions
from cumin.objectselector import ObjectSelector, MonitorSelfStatColumn, ObjectTableColumn, ObjectTable,\
ObjectLinkColumn, CsvStatsExporter, ExportButton
from cumin.util import rgb_to_string
from negotiator import NegotiatorAttribute
-from wooly.template import WidgetTemplate
strings = StringCatalog(__file__)
log = logging.getLogger("cumin.dashboard")
@@ -715,6 +717,7 @@
return "Slot breakdown by OS"
def do_get_items(self, session):
+ # (index, (name, value))
return [(i, x) for i, x in enumerate(self.get_records(session))]
def is_total(self, item):
@@ -733,7 +736,9 @@
return self.get_item_value(session, item)
def render_html_title(self, session, item):
- return None
+ (_, (name, value)) = item
+ os, _, state = rpartition(name, " ")
+ return "There are %d %s slots with an OS of %s" % (value, state, os)
def get_legend_class(self, session, this_item):
items = self.do_get_items(session)
13 years, 1 month
r4702 - trunk/parsley/python/parsley
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-04-11 20:13:41 +0000 (Mon, 11 Apr 2011)
New Revision: 4702
Modified:
trunk/parsley/python/parsley/loggingex.py
Log:
Additional tweak for MyRotatingFileHandler to make it work with Python 2.4
Modified: trunk/parsley/python/parsley/loggingex.py
===================================================================
--- trunk/parsley/python/parsley/loggingex.py 2011-04-11 19:37:18 UTC (rev 4701)
+++ trunk/parsley/python/parsley/loggingex.py 2011-04-11 20:13:41 UTC (rev 4702)
@@ -47,6 +47,20 @@
stat = os.stat(self.baseFilename)
self.dev, self.ino = stat[ST_DEV], stat[ST_INO]
+ def _reopen(self):
+ """
+ Reimplementation of FileHandler._open() from Python 2.6, because
+ Python 2.4 does not have _open (and hence, it cannot be called)
+
+ Open the current base file with the (original) mode and encoding.
+ Return the resulting stream.
+ """
+ if self.encoding is None:
+ stream = open(self.baseFilename, self.mode)
+ else:
+ stream = codecs.open(self.baseFilename, self.mode, self.encoding)
+ return stream
+
def emit(self, record):
# Following snippett taken from WatchedFileHandler in Python 2.6
# Reopen the stream if the original file has been moved
@@ -59,7 +73,7 @@
if changed and self.stream is not None:
self.stream.flush()
self.stream.close()
- self.stream = self._open()
+ self.stream = self._reopen()
if stat is None:
stat = os.stat(self.baseFilename)
self.dev, self.ino = stat[ST_DEV], stat[ST_INO]
13 years, 1 month
r4701 - trunk/cumin/python/cumin/grid
by eallen@fedoraproject.org
Author: eallen
Date: 2011-04-11 19:37:18 +0000 (Mon, 11 Apr 2011)
New Revision: 4701
Modified:
trunk/cumin/python/cumin/grid/dashboard.py
trunk/cumin/python/cumin/grid/dashboard.strings
Log:
Added some title text (mouseover hover) for the stat tables
Modified: trunk/cumin/python/cumin/grid/dashboard.py
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.py 2011-04-11 19:30:45 UTC (rev 4700)
+++ trunk/cumin/python/cumin/grid/dashboard.py 2011-04-11 19:37:18 UTC (rev 4701)
@@ -109,6 +109,11 @@
self.export = ExportButton(self.app, "export", (object,), exporter, title)
self.add_child(self.export)
+ def render_html_title(self, session, item):
+ unit = item.unit and " (%s)" % item.unit or ""
+ description = item.description and item.description or "%s from the %s table" % (item.name, item.cls._name)
+ return "%s%s" % (description, unit)
+
# Displays a pie chart and a set of stats as the legend
# The legend is a definition list with the dt being the stat name
# and the dd being the value
@@ -392,9 +397,6 @@
def render_item_title(self, session, item):
return item.title
- def render_html_title(self, session, item):
- return item.description
-
def get_item_value(self, session, item):
record = self.get_record(session)
value = record[self.get_item_index(item)] or 0
@@ -468,9 +470,6 @@
record = self.get_record(session)
return record[self.get_item_index(item)] or 0
- def render_html_title(self, session, item):
- return item.description
-
def get_legend_class(self, session, item):
index = self.get_item_index(item)
return "legend%s" % rgb_to_string(*(PieChartPage.color_schemes[self.color_scheme][index]))
@@ -553,7 +552,7 @@
def render_html_title(self, session, item):
if item is self.PERCENT_COLUMN:
return item
- return item.description
+ return super(DashboardCapacitySlotSummary, self).render_html_title(session, item)
def get_legend_class(self, session, item):
return "blank"
@@ -617,6 +616,10 @@
index = self.attrs.index(item[0].name)
return "legend%s" % rgb_to_string(*(PieChartPage.color_schemes[self.color_scheme][index]))
+ def render_html_title(self, session, item):
+ index = self.attrs.index(item[0].name)
+ return "Aggregate of %s for all slots" % self.attrs[index]
+
class DashboardOSData(ObjectSqlAdapter):
def __init__(self, app, collector):
cls = app.model.com_redhat_grid.Slot
@@ -802,6 +805,9 @@
def get_legend_class(self, session, item):
return "blank"
+ def render_html_title(self, session, item):
+ return super(JobThroughput, self).render_html_title(session, item[0])
+
class NegotiatorCycles(NegotiatorDefinitionStatSet):
def __init__(self, app, name, collector):
super(NegotiatorCycles, self).__init__(app, name, collector, "negotiator.cycles")
Modified: trunk/cumin/python/cumin/grid/dashboard.strings
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.strings 2011-04-11 19:30:45 UTC (rev 4700)
+++ trunk/cumin/python/cumin/grid/dashboard.strings 2011-04-11 19:37:18 UTC (rev 4701)
@@ -209,7 +209,7 @@
[DefinitionSet.item_html]
<dt title="{html_title}" class="{legend_class}"><span class="legend_block"></span>{item_title}</dt>
- <dd{dd_class}><span>{item_value}</span></dd>
+ <dd title="{html_title}" {dd_class}><span>{item_value}</span></dd>
[NegotiatorJobThroughput.css]
div.NegotiatorJobThroughput {
@@ -276,7 +276,7 @@
[DashboardSummaryStats.item_html]
<dt title="{html_title}">{item_title}</dt>
- <dd><span>{item_value}</span></dd>
+ <dd title="{html_title}"><span>{item_value}</span></dd>
[FootnoteDashboardSummaryStats.css]
div.FootnoteDashboardSummaryStats div.footnote {
13 years, 1 month
r4700 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-04-11 19:30:45 +0000 (Mon, 11 Apr 2011)
New Revision: 4700
Modified:
trunk/cumin/python/cumin/grid/scheduler.py
trunk/cumin/python/cumin/grid/scheduler.strings
Log:
Per BZ https://bugzilla.redhat.com/show_bug.cgi?id=694883 I have added text to the Grid->Schedulers(select
one)->Overview->Performance page to indicate the sampling window of the stats. The text now reads "*The following stats are averaged over a 300 second sampling window" where "300" is read from the database which reports the current condor configuration.
Modified: trunk/cumin/python/cumin/grid/scheduler.py
===================================================================
--- trunk/cumin/python/cumin/grid/scheduler.py 2011-04-11 15:06:30 UTC (rev 4699)
+++ trunk/cumin/python/cumin/grid/scheduler.py 2011-04-11 19:30:45 UTC (rev 4700)
@@ -194,6 +194,11 @@
def render_title(self, session):
return "Performance"
+
+ def render_statswindow(self, session):
+ # get the average WindowedStarWidth for all schedulers
+ statswindow = self.frame.object.get(session).WindowedStatWidth
+ return statswindow
class HourChart(StatFlashChart):
def __init__(self, app, name, scheduler):
Modified: trunk/cumin/python/cumin/grid/scheduler.strings
===================================================================
--- trunk/cumin/python/cumin/grid/scheduler.strings 2011-04-11 15:06:30 UTC (rev 4699)
+++ trunk/cumin/python/cumin/grid/scheduler.strings 2011-04-11 19:30:45 UTC (rev 4700)
@@ -25,7 +25,16 @@
float: left;
}
+div.statsnote {
+ font-style: italic;
+ font-size: 80%;
+ padding-bottom: 0.5em;
+}
+
[SchedulerOverviewCycle.html]
+<div class="statsnote">
+ *The following stats are averaged over a {statswindow} second sampling window
+</div>
<div class="{class}">
{charts}
</div>
13 years, 1 month
r4699 - trunk/parsley/python/parsley
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-04-11 15:06:30 +0000 (Mon, 11 Apr 2011)
New Revision: 4699
Modified:
trunk/parsley/python/parsley/loggingex.py
Log:
Made MyRotatingFileHandler a hybrid between WatchedFileHandler and
RotatingFileHandler. Functionality from WatchedFileHandler reopens
a stream if the file has been renamed since originally opened.
BZ677398
Modified: trunk/parsley/python/parsley/loggingex.py
===================================================================
--- trunk/parsley/python/parsley/loggingex.py 2011-04-08 12:31:19 UTC (rev 4698)
+++ trunk/parsley/python/parsley/loggingex.py 2011-04-11 15:06:30 UTC (rev 4699)
@@ -1,5 +1,6 @@
import logging
import os
+from stat import ST_DEV, ST_INO
import traceback
import select
@@ -32,17 +33,47 @@
class MyRotatingFileHandler(RotatingFileHandler):
def __init__(self, filename, maxBytes, backupCount):
- RotatingFileHandler.__init__(self,
+ RotatingFileHandler.__init__(self,
filename,
maxBytes = maxBytes,
backupCount = backupCount)
+ # Following snippett taken from WatchedFileHandler in Python 2.6.
+ # Essentially, we need a hybrid between a RotatingFileHandler
+ # and a WatchedFileHandler since we may have multiple rotaters all
+ # logging to the same file.
+ if not os.path.exists(self.baseFilename):
+ self.dev, self.ino = -1, -1
+ else:
+ stat = os.stat(self.baseFilename)
+ self.dev, self.ino = stat[ST_DEV], stat[ST_INO]
+ def emit(self, record):
+ # Following snippett taken from WatchedFileHandler in Python 2.6
+ # Reopen the stream if the original file has been moved
+ if not os.path.exists(self.baseFilename):
+ stat = None
+ changed = 1
+ else:
+ stat = os.stat(self.baseFilename)
+ changed = (stat[ST_DEV] != self.dev) or (stat[ST_INO] != self.ino)
+ if changed and self.stream is not None:
+ self.stream.flush()
+ self.stream.close()
+ self.stream = self._open()
+ if stat is None:
+ stat = os.stat(self.baseFilename)
+ self.dev, self.ino = stat[ST_DEV], stat[ST_INO]
+
+ # Now that we've reopened the file if necessary, call the regular
+ # emit() routine for the rotating handler.
+ RotatingFileHandler.emit(self, record)
+
def doRollover(self):
RotatingFileHandler.doRollover(self)
- if hasattr(self, "baseFilename"):
- # Try to fix up permissions on new file
- set_log_owner(self.baseFilename)
+ # Try to fix up permissions on new file
+ set_log_owner(self.baseFilename)
+
def enable_logging(name, level, file_obj, max_MB = 0, max_archives = 0):
assert level
assert file_obj
13 years, 1 month
r4698 - trunk/cumin/python/cumin/grid
by eallen@fedoraproject.org
Author: eallen
Date: 2011-04-08 12:31:19 +0000 (Fri, 08 Apr 2011)
New Revision: 4698
Modified:
trunk/cumin/python/cumin/grid/slotvis.py
Log:
Remove extra slot vis groupings
Modified: trunk/cumin/python/cumin/grid/slotvis.py
===================================================================
--- trunk/cumin/python/cumin/grid/slotvis.py 2011-04-07 19:16:35 UTC (rev 4697)
+++ trunk/cumin/python/cumin/grid/slotvis.py 2011-04-08 12:31:19 UTC (rev 4698)
@@ -189,9 +189,6 @@
self.add_state("System", "By system")
self.add_state("AccountingGroup", "By accounting group")
self.add_state("Activity|State", "By activity/state")
- self.add_state("Arch", "By architecture")
- self.add_state("OpSys", "By operating system")
- #self.add_state("OpSys", "By opsys")
def get_click(self, session, state):
href = self.parent.render_slots_href(session)
13 years, 1 month
r4697 - trunk/cumin/python/cumin/grid
by eallen@fedoraproject.org
Author: eallen
Date: 2011-04-07 19:16:35 +0000 (Thu, 07 Apr 2011)
New Revision: 4697
Modified:
trunk/cumin/python/cumin/grid/scheduler.py
Log:
Clean up flash chart classes
Modified: trunk/cumin/python/cumin/grid/scheduler.py
===================================================================
--- trunk/cumin/python/cumin/grid/scheduler.py 2011-04-07 19:15:54 UTC (rev 4696)
+++ trunk/cumin/python/cumin/grid/scheduler.py 2011-04-07 19:16:35 UTC (rev 4697)
@@ -157,37 +157,37 @@
charts = WidgetSet(app, "charts")
self.add_child(charts)
- chart = self.TitledChart(app, "submitted", scheduler)
+ chart = self.HourChart(app, "submitted", scheduler)
chart.title = "Submitted/started/completed"
chart.stats = ("JobsSubmitted", "JobsStarted", "JobsCompleted")
charts.add_child(chart)
- chart = self.TitledChart(app, "started", scheduler)
+ chart = self.HourChart(app, "started", scheduler)
chart.title = "Rates"
chart.stats = ("JobSubmissionRate", "JobStartRate", "JobCompletionRate")
charts.add_child(chart)
- chart = self.TitledChart(app, "completed", scheduler)
+ chart = self.HourChart(app, "completed", scheduler)
chart.title = "Cumulative"
chart.stats = ("JobsSubmittedCum", "JobsStartedCum", "JobsCompletedCum")
charts.add_child(chart)
- chart = self.TitledChart(app, "exited", scheduler)
+ chart = self.HourChart(app, "exited", scheduler)
chart.title = "Exited"
chart.stats = ("JobsExited", "JobsExitedCum")
charts.add_child(chart)
- chart = self.TitledChart(app, "exception", scheduler)
+ chart = self.HourChart(app, "exception", scheduler)
chart.title = "Shadow exceptions"
chart.stats = ("ShadowExceptions", "ShadowExceptionsCum")
charts.add_child(chart)
- chart = self.TitledChart(app, "start_time", scheduler)
+ chart = self.HourChart(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 = self.HourChart(app, "running_time", scheduler)
chart.title = "Mean running times"
chart.stats = ("MeanRunningTime", "MeanRunningTimeCum", "SumRunningTimeCum")
charts.add_child(chart)
@@ -195,12 +195,8 @@
def render_title(self, session):
return "Performance"
- class TitledChart(StatFlashChart):
+ class HourChart(StatFlashChart):
def __init__(self, app, name, scheduler):
- super(SchedulerOverviewCycle.TitledChart, self).__init__(app, name, scheduler)
+ super(SchedulerOverviewCycle.HourChart, self).__init__(app, name, scheduler)
- self.title = None
self.duration.param.default = "3600"
-
- def render_title(self, session):
- return self.title
13 years, 1 month
r4696 - trunk/cumin/python/cumin
by eallen@fedoraproject.org
Author: eallen
Date: 2011-04-07 19:15:54 +0000 (Thu, 07 Apr 2011)
New Revision: 4696
Modified:
trunk/cumin/python/cumin/stat.py
Log:
Added ability to set the title on a flashchart
Modified: trunk/cumin/python/cumin/stat.py
===================================================================
--- trunk/cumin/python/cumin/stat.py 2011-04-07 18:28:52 UTC (rev 4695)
+++ trunk/cumin/python/cumin/stat.py 2011-04-07 19:15:54 UTC (rev 4696)
@@ -137,6 +137,7 @@
self.mode = None
self.stats = ()
self.chart_type = None
+ self.title = None
self.stats_tmpl = WidgetTemplate(self, "stat_html")
@@ -180,6 +181,9 @@
return self.fullpageable and " fullpageable" or ""
def render_title(self, session):
+ if self.title:
+ return self.title
+
object = self.object.get(session)
cls = object._class
return getattr(cls, self.stats[0]).title
13 years, 1 month