Branch created for 1.3.2 BZ related fixes
by Trevor McKay
Dear all,
I have an idea. I've created a 1.3.2 branch to use for package builds
for 1.3.2. You can continue to commit to trunk, but please make sure to
label commits with a BZ number in the comments if it is BZ related.
Stuff that is approved for inclusion in 1.3.2, I will merge over.
This way we can control easily and precisely what is passed on to QE for
a particular release, without a lot fuss.
Best,
Trevor
13 years, 4 months
r4455 - branches
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-01-07 15:13:08 +0000 (Fri, 07 Jan 2011)
New Revision: 4455
Added:
branches/1.3.2/
Log:
Create a branch for receiving BZ related changes for 1.3.2.
Copied: branches/1.3.2 (from rev 4451, trunk)
13 years, 4 months
r4454 - trunk/cumin/bin
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-01-07 13:54:34 +0000 (Fri, 07 Jan 2011)
New Revision: 4454
Modified:
trunk/cumin/bin/cumin-database
Log:
Modified comment around database initialize
Modified: trunk/cumin/bin/cumin-database
===================================================================
--- trunk/cumin/bin/cumin-database 2011-01-06 23:00:14 UTC (rev 4453)
+++ trunk/cumin/bin/cumin-database 2011-01-07 13:54:34 UTC (rev 4454)
@@ -174,9 +174,10 @@
# On older versions of Postgres (before 8.4), initdb does not exist but
# using the start option will initialize the database, then start it.
- # Try initdb first, and if it fails try start followed by stop. This
- # should leave the database and the service in the same state on all
- # 8.x versions of Postgres.
+ # Try initdb first, and if it fails try start. The "start" method
+ # will leave the service running, which is different than initdb,
+ # but that is fine at this point because it is restarted after
+ # the call to configure anyway.
echo -e "\nAttempting to use initdb option..."
run "/sbin/service postgresql initdb" || {
echo -e "\ninitdb option not supported, using start..."
13 years, 4 months
r4453 - trunk/cumin/bin
by matt@fedoraproject.org
Author: matt
Date: 2011-01-06 23:00:14 +0000 (Thu, 06 Jan 2011)
New Revision: 4453
Modified:
trunk/cumin/bin/cumin-database
Log:
Implemented restart of postgresql with condstop + start to work around
a but in postgresql's init script when restarting a stopped service.
Modified: trunk/cumin/bin/cumin-database
===================================================================
--- trunk/cumin/bin/cumin-database 2011-01-06 22:55:41 UTC (rev 4452)
+++ trunk/cumin/bin/cumin-database 2011-01-06 23:00:14 UTC (rev 4453)
@@ -151,7 +151,11 @@
check-environment || exit 1
check-initialized || exit 1
- /sbin/service postgresql restart
+ # The postgresql 8.1.22 init script violates LSB 3.1 Chapter 20.2,
+ # and returns 1 on a successful restart of a stopped service. A
+ # proper restart is thus simulated with condstop and start.
+ /sbin/service postgresql condstop
+ /sbin/service postgresql start
}
function initialize {
13 years, 4 months
r4452 - trunk/parsley/python/parsley
by jross@fedoraproject.org
Author: jross
Date: 2011-01-06 22:55:41 +0000 (Thu, 06 Jan 2011)
New Revision: 4452
Modified:
trunk/parsley/python/parsley/config.py
Log:
Make the config parser tolerant of missing sections
Modified: trunk/parsley/python/parsley/config.py
===================================================================
--- trunk/parsley/python/parsley/config.py 2011-01-06 16:22:58 UTC (rev 4451)
+++ trunk/parsley/python/parsley/config.py 2011-01-06 22:55:41 UTC (rev 4452)
@@ -24,7 +24,7 @@
try:
values = section.parse(parser)
except NoSectionError:
- continue
+ values = None
sections[section.name] = values
@@ -44,27 +44,26 @@
def parse(self, parser):
values = ConfigValues()
+ self.add_values(parser, "common", values)
+ self.add_values(parser, self.name, values)
+
+ return values
+
+ def add_values(self, parser, section_name, values):
+ if not parser.has_section(section_name):
+ return
+
for param in self.parameters:
name = param.name.replace("-", "_")
- string = None
try:
- string = parser.get(self.name, param.name)
+ string = parser.get(section_name, param.name)
+ value = param.unmarshal(string)
except NoOptionError:
- try:
- string = parser.get("common", param.name)
- except NoOptionError:
- pass
-
- if string is None:
value = param.default
- else:
- value = param.unmarshal(string)
values[name] = value
- return values
-
class ConfigParameter(object):
def __init__(self, section, name, type):
assert isinstance(section, ConfigSection)
13 years, 4 months
r4451 - trunk/cumin/bin
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-01-06 16:22:58 +0000 (Thu, 06 Jan 2011)
New Revision: 4451
Modified:
trunk/cumin/bin/cumin-database
Log:
Remove call to stop postgres service on RHEL after initdb call
BZ667653
Modified: trunk/cumin/bin/cumin-database
===================================================================
--- trunk/cumin/bin/cumin-database 2011-01-05 15:54:51 UTC (rev 4450)
+++ trunk/cumin/bin/cumin-database 2011-01-06 16:22:58 UTC (rev 4451)
@@ -177,7 +177,6 @@
run "/sbin/service postgresql initdb" || {
echo -e "\ninitdb option not supported, using start..."
run "/sbin/service postgresql start"
- run "/sbin/service postgresql stop"
}
# now check again, to make sure one of the two methods worked
13 years, 4 months
r4450 - branches/scale_testing/bin
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-01-05 15:54:51 +0000 (Wed, 05 Jan 2011)
New Revision: 4450
Added:
branches/scale_testing/bin/process_prof.py
Log:
Add a script to process profile data dumped by the web server
Added: branches/scale_testing/bin/process_prof.py
===================================================================
--- branches/scale_testing/bin/process_prof.py (rev 0)
+++ branches/scale_testing/bin/process_prof.py 2011-01-05 15:54:51 UTC (rev 4450)
@@ -0,0 +1,70 @@
+#!/usr/bin/python
+
+# make profiling a configuration flag for cumin-web
+# pass the flag to CherryPi, run the profiler if on
+# also if on, comment out the shrink code so that we don't
+# recreate threads (actually, maybe the thread id monotonically increases?
+
+#write a little test program to see if thread ids keep increasing after exit. If that is the case, then we don't have to turn off shrink.
+
+
+
+import os
+import pstats
+import sys
+
+def outputStats(p):
+ p.sort_stats('time').print_stats()
+ p.print_callers(10)
+ p.sort_stats('cum').print_stats()
+ p.print_callers(10)
+
+def main():
+ if len(sys.argv) != 2:
+ print "Forgot the directory, didn't you?"
+ return
+
+ # Just in case we want to put things back
+ curr_path = os.getcwd()
+ save_std_out = sys.stdout
+ total = None
+
+ os.chdir(sys.argv[1])
+ l = os.listdir('.')
+ for f in l:
+ # For some reason sys.stdout is bound when Stats is
+ # created, so it has to be set here before we create
+ # the object. Even though we might fail...
+ out = open(f+".prof", "w+")
+ sys.stdout = out
+ try:
+ p = pstats.Stats(f)
+ except:
+ # Well, we don't need this anymore :)
+ out.close()
+ os.remove(f+".prof")
+ continue
+
+ # Print sorted by time, with callers of to 10
+ # Then by cumulative time and callers to the same file
+ outputStats(p)
+ out.close()
+
+ # Keep a running total as well that we can look at
+ # in another file
+ if total == None:
+ total = p
+ else:
+ total.add(p)
+
+ # Now that we're done with the whole loop, save the combined
+ # stats, then play our game with standard out to produce the file
+ total.dump_stats('combined_total')
+
+ out = open("combined_total.prof", "w+")
+ sys.stdout = out
+ total = pstats.Stats('combined_total')
+ outputStats(total)
+
+if __name__ == "__main__":
+ main()
Property changes on: branches/scale_testing/bin/process_prof.py
___________________________________________________________________
Name: svn:executable
+ *
13 years, 4 months
r4449 - in branches/scale_testing: . cumin/python/cumin cumin/python/cumin/grid cumin/python/cumin/inventory cumin/python/cumin/messaging mint/python/mint wooly/python/wooly wooly/python/wooly/wsgiserver
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-01-05 15:18:06 +0000 (Wed, 05 Jan 2011)
New Revision: 4449
Modified:
branches/scale_testing/README
branches/scale_testing/cumin/python/cumin/grid/job.py
branches/scale_testing/cumin/python/cumin/grid/job.strings
branches/scale_testing/cumin/python/cumin/grid/negotiator.py
branches/scale_testing/cumin/python/cumin/grid/pool.py
branches/scale_testing/cumin/python/cumin/grid/scheduler.py
branches/scale_testing/cumin/python/cumin/grid/slot.py
branches/scale_testing/cumin/python/cumin/grid/submission.py
branches/scale_testing/cumin/python/cumin/grid/submitter.py
branches/scale_testing/cumin/python/cumin/inventory/system.py
branches/scale_testing/cumin/python/cumin/messaging/binding.py
branches/scale_testing/cumin/python/cumin/messaging/broker.py
branches/scale_testing/cumin/python/cumin/messaging/brokerlink.py
branches/scale_testing/cumin/python/cumin/messaging/connection.py
branches/scale_testing/cumin/python/cumin/messaging/exchange.py
branches/scale_testing/cumin/python/cumin/messaging/queue.py
branches/scale_testing/cumin/python/cumin/messaging/subscription.py
branches/scale_testing/cumin/python/cumin/model.py
branches/scale_testing/cumin/python/cumin/objectselector.py
branches/scale_testing/cumin/python/cumin/objectselector.strings
branches/scale_testing/cumin/python/cumin/qmfadapter.py
branches/scale_testing/mint/python/mint/update.py
branches/scale_testing/wooly/python/wooly/datatable.py
branches/scale_testing/wooly/python/wooly/wsgiserver/__init__.py
Log:
Merge chagnes from trunk into branch, tweak stats
Modified: branches/scale_testing/README
===================================================================
--- branches/scale_testing/README 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/README 2011-01-05 15:18:06 UTC (rev 4449)
@@ -89,6 +89,7 @@
Confirm new password: # Re-type said password
User 'guest' is added
+
USING THE DEVEL ENVIRONMENT
---------------------------
Modified: branches/scale_testing/cumin/python/cumin/grid/job.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/grid/job.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/grid/job.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -199,7 +199,7 @@
super(JobSelector, self).__init__(app, name, cls)
- self.adapter = JobSummariesAdapter(app, cls)
+ self.table.adapter = JobSummariesAdapter(app, cls)
self.submission = submission
frame = "main.grid.pool.submission.job"
@@ -216,9 +216,7 @@
self.job_id_column.visible = False
self.add_column(self.job_id_column)
- self.error_tmpl = WidgetTemplate(self, "error_html")
- self.qmf_response = Attribute(app, "qmf_response")
- self.add_attribute(self.qmf_response)
+ #self.add_search_filter(cls.GlobalJobId)
JobSelectionHold(app, self, "held")
JobSelectionRelease(app, self, "released")
@@ -234,16 +232,67 @@
(app, "id", cls.JobId, self.ids)
self.add_column(self.checkbox_column)
+ def create_table(self, app, name, cls):
+ return JobSelectorTable(app, name, cls)
+
def render_dynamic_header(self, session):
values = self.get_data_values(session)
- count = self.adapter.get_count(values)
- max_sort = self.adapter.max_sortable_records
+ count = self.table.adapter.get_count(values)
+ max_sort = self.table.adapter.max_sortable_records
return count <= max_sort
+ def do_render(self, session):
+ if self.table.is_exception(session):
+ return self.table.render(session)
+
+ return super(JobSelector, self).do_render(session)
+
def render_title(self, session):
return "Jobs"
+ class JobIdColumn(DynamicSortableObjectLinkColumn):
+ def render_cell_href(self, session, record):
+ if len(record) == 0:
+ return ""
+ job_id = record[self.parent.parent.job_id_column.field.index]
+ #frame = self.page.page_widgets_by_path[self.frame_path]
+ frame = self.table.parent.frame.job
+
+ submission = self.parent.parent.submission.get(session)
+ return frame.get_href(session, submission._id, job_id)
+
+class JobSelectorTable(ObjectSelectorTable):
+ def __init__(self, app, name, cls):
+ super(JobSelectorTable, self).__init__(app, name, cls)
+
+ self.error_tmpl = WidgetTemplate(self, "error_html")
+ self.qmf_response = Attribute(app, "qmf_response")
+ self.add_attribute(self.qmf_response)
+
+ def get_data_values(self, session):
+ values = super(JobSelectorTable, self).get_data_values(session)
+
+ submission = self.parent.submission.get(session)
+
+ if submission:
+ values['obj'] = submission
+ values['args'] = ()
+ return values
+
+ def get_data(self, session):
+ values = self.get_data_values(session)
+ options = self.get_data_options(session)
+
+ results, qmf_response = self.adapter.get_data(values, options)
+ self.qmf_response.set(session, qmf_response)
+ return results
+
+ def is_exception(self, session):
+ self.get_data(session)
+ qmf_response = self.qmf_response.get(session)
+ return qmf_response.exception and True or False
+
def do_render(self, session):
# determine if there is an error getting the data
# and show an error message
@@ -255,38 +304,11 @@
self.error_tmpl.render(writer, session, msg)
return writer.to_string()
- return super(JobSelector, self).do_render(session)
+ return super(JobSelectorTable, self).do_render(session)
- def get_data(self, session):
- values = self.get_data_values(session)
- options = self.get_data_options(session)
-
- results, qmf_response = self.adapter.get_data(values, options)
- self.qmf_response.set(session, qmf_response)
- return results
-
def render_error_msg(self, session, msg):
return msg
- def get_data_values(self, session):
- values = super(JobSelector, self).get_data_values(session)
-
- submission = self.submission.get(session)
-
- if submission:
- values['obj'] = submission
- values['args'] = ()
- return values
-
- class JobIdColumn(DynamicSortableObjectLinkColumn):
- def render_cell_href(self, session, record):
- job_id = record[self.parent.job_id_column.field.index]
- #frame = self.page.page_widgets_by_path[self.frame_path]
- frame = self.table.frame.job
-
- submission = self.parent.submission.get(session)
- return frame.get_href(session, submission._id, job_id)
-
class JobObjectSelectorTask(ObjectSelectorTask):
def __init__(self, app, selector, verb):
super(JobObjectSelectorTask, self).__init__(app, selector)
Modified: branches/scale_testing/cumin/python/cumin/grid/job.strings
===================================================================
--- branches/scale_testing/cumin/python/cumin/grid/job.strings 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/grid/job.strings 2011-01-05 15:18:06 UTC (rev 4449)
@@ -173,7 +173,7 @@
{loading}
</textarea>
-[JobSelector.error_html]
+[JobSelectorTable.error_html]
<div id="{id}">
<div class="TaskInvocationSet">
<ul>
Modified: branches/scale_testing/cumin/python/cumin/grid/negotiator.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/grid/negotiator.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/grid/negotiator.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -45,6 +45,21 @@
self.add_attribute_column(cls.Machine)
self.add_attribute_column(cls.System)
+ stat = MonitorSelfStatColumn(app, cls.MonitorSelfAge.name, cls.MonitorSelfAge)
+ self.add_column(stat)
+ stat = MonitorSelfStatColumn(app, cls.MonitorSelfCPUUsage.name, cls.MonitorSelfCPUUsage)
+ self.add_column(stat)
+ stat = MonitorSelfStatColumn(app, cls.MonitorSelfImageSize.name, cls.MonitorSelfImageSize)
+ self.add_column(stat)
+ #stat = MonitorSelfStatColumn(app, cls.MonitorSelfRegisteredSocketCount.name, cls.MonitorSelfRegisteredSocketCount)
+ #self.add_column(stat)
+ #stat = MonitorSelfStatColumn(app, cls.MonitorSelfResidentSetSize.name, cls.MonitorSelfResidentSetSize)
+ #self.add_column(stat)
+ stat = MonitorSelfStatColumn(app, cls.MonitorSelfTime.name, cls.MonitorSelfTime)
+ self.add_column(stat)
+
+ self.add_search_filter(cls.Name)
+
#self.start = DaemonSelectionStart(app, self, "NEGOTIATOR")
#self.stop = DaemonSelectionStop(app, self, "NEGOTIATOR")
@@ -361,6 +376,8 @@
def split_group_names(self, group_string):
groups = []
g_string = group_string.replace(", ", ",")
+ if not "," in g_string:
+ return g_string.split()
return g_string.split(",")
def get_config_for_groups(self, session, config, groups):
Modified: branches/scale_testing/cumin/python/cumin/grid/pool.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/grid/pool.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/grid/pool.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -53,7 +53,7 @@
when = "now() - interval '1 day'"
filter = SqlComparisonFilter(table._qmf_update_time, when, ">")
- self.adapter.query.add_filter(filter)
+ self.table.adapter.query.add_filter(filter)
class PoolNameColumn(ObjectLinkColumn):
def render_header_content(self, session):
Modified: branches/scale_testing/cumin/python/cumin/grid/scheduler.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/grid/scheduler.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/grid/scheduler.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -86,6 +86,17 @@
self.add_attribute_column(cls.TotalRunningJobs)
self.add_attribute_column(cls.TotalHeldJobs)
+ stat = MonitorSelfStatColumn(app, cls.MonitorSelfAge.name, cls.MonitorSelfAge)
+ self.add_column(stat)
+ stat = MonitorSelfStatColumn(app, cls.MonitorSelfCPUUsage.name, cls.MonitorSelfCPUUsage)
+ self.add_column(stat)
+ stat = MonitorSelfStatColumn(app, cls.MonitorSelfImageSize.name, cls.MonitorSelfImageSize)
+ self.add_column(stat)
+ stat = MonitorSelfStatColumn(app, cls.MonitorSelfTime.name, cls.MonitorSelfTime)
+ self.add_column(stat)
+
+ self.add_search_filter(cls.Name)
+
#self.start = DaemonSelectionStart(app, self, "SCHEDD")
#self.stop = DaemonSelectionStop(app, self, "SCHEDD")
@@ -95,7 +106,10 @@
self.attrs = ("NumUsers", "TotalRunningJobs",
"TotalIdleJobs", "TotalHeldJobs",
- "TotalJobAds", "TotalRemovedJobs")
+ "TotalJobAds", "TotalRemovedJobs",
+ "MonitorSelfAge", "MonitorSelfCPUUsage",
+ "MonitorSelfImageSize","MonitorSelfRegisteredSocketCount",
+ "MonitorSelfResidentSetSize","MonitorSelfTime")
class SchedulerOverview(Widget):
def __init__(self, app, name, scheduler):
Modified: branches/scale_testing/cumin/python/cumin/grid/slot.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/grid/slot.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/grid/slot.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -24,6 +24,7 @@
self.pool = pool
self.add_filter(self.pool, cls.Pool, cls.Pool)
+ self.add_search_filter(cls.Name)
frame = "main.grid.pool.slot"
col = ObjectLinkColumn(app, "name", cls.Name, cls._id, frame)
@@ -451,7 +452,7 @@
return item[0][2] and "class='%s'" % item[0][2] or ""
class SlotStates(ItemSet):
- states = ("Unclaimed", "Claimed", "Owner", "Matched", "Preempting")
+ states = ("Unclaimed", "Claimed", "Unavailable", "Matched", "Preempting")
def do_get_items(self, session):
return self.states
Modified: branches/scale_testing/cumin/python/cumin/grid/submission.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/grid/submission.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/grid/submission.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -63,13 +63,15 @@
super(SubmissionSelector, self).__init__(app, name, cls)
- self.adapter = SubmissionData(app)
+ self.table.adapter = SubmissionData(app)
self.add_attribute_column(cls.Idle)
self.add_attribute_column(cls.Running)
self.add_attribute_column(cls.Completed)
self.add_attribute_column(cls.Held)
+ self.add_search_filter(cls.Name)
+
class PoolSubmissionSelector(SubmissionSelector):
def __init__(self, app, name, pool):
super(PoolSubmissionSelector, self).__init__(app, name)
@@ -108,7 +110,7 @@
super(PoolSubmissionSchedulerSelector, self).__init__(app, name, pool)
scheduler = app.model.com_redhat_grid.Scheduler
- self.SchedulerJoin(app, self.adapter.query, self.cls.sql_table,
+ self.SchedulerJoin(app, self.table.adapter.query, self.cls.sql_table,
self.cls.jobserverRef.sql_column, "jid")
frame = "main.grid.pool.scheduler"
Modified: branches/scale_testing/cumin/python/cumin/grid/submitter.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/grid/submitter.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/grid/submitter.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -50,6 +50,8 @@
self.add_attribute_column(cls.RunningJobs)
self.add_attribute_column(cls.HeldJobs)
+ self.add_search_filter(cls.Name)
+
class SubmitterGeneralStatSet(StatSet):
def __init__(self, app, name, object):
super(SubmitterGeneralStatSet, self).__init__(app, name, object)
Modified: branches/scale_testing/cumin/python/cumin/inventory/system.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/inventory/system.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/inventory/system.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -30,6 +30,8 @@
self.add_attribute_column(cls.memFree)
self.add_attribute_column(cls.loadAverage1Min)
+ self.add_search_filter(cls.nodeName)
+
class SystemFrame(ObjectFrame):
def __init__(self, app, name):
cls = app.model.com_redhat_sesame.Sysimage
Modified: branches/scale_testing/cumin/python/cumin/messaging/binding.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/messaging/binding.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/messaging/binding.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -134,7 +134,7 @@
super(BindingSelector, self).__init__(app, name, binding)
- self.adapter = BindingData(app)
+ self.table.adapter = BindingData(app)
frame = "main.messaging.broker.binding"
col = ObjectLinkColumn \
@@ -156,6 +156,8 @@
self.remove = BindingSelectionRemove(app, self)
+ self.add_search_filter(binding.bindingKey)
+
class Exchange(ObjectLinkColumn):
def render_header_content(self, session):
return "Exchange"
Modified: branches/scale_testing/cumin/python/cumin/messaging/broker.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/messaging/broker.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/messaging/broker.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -65,7 +65,7 @@
super(BrokerSelector, self).__init__(app, name, broker)
- self.adapter = BrokerData(app)
+ self.table.adapter = BrokerData(app)
self.group = SessionAttribute(self, "group")
Modified: branches/scale_testing/cumin/python/cumin/messaging/brokerlink.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/messaging/brokerlink.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/messaging/brokerlink.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -73,6 +73,8 @@
self.add_attribute_column(cls.transport)
self.add_attribute_column(cls.durable)
+ self.add_search_filter(cls.host)
+
self.remove = BrokerLinkSelectionRemove(app, self)
# Address column XXX
@@ -100,6 +102,8 @@
self.add_attribute_column(cls.tag)
self.add_attribute_column(cls.excludes)
+ self.add_search_filter(cls.src)
+
self.remove = RouteSelectionRemove(app, self)
class RouteSelectionRemove(ObjectSelectorTask):
Modified: branches/scale_testing/cumin/python/cumin/messaging/connection.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/messaging/connection.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/messaging/connection.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -74,6 +74,8 @@
self.add_attribute_column(cls.bytesFromClient)
self.add_attribute_column(cls.bytesToClient)
+ self.add_search_filter(cls.address)
+
self.close = ConnectionSelectionClose(app, self)
class ConnectionSelectionClose(ObjectSelectorTask):
@@ -194,6 +196,8 @@
self.add_attribute_column(cls.framesOutstanding)
self.add_attribute_column(cls.clientCredit)
+ self.add_search_filter(cls.name)
+
self.close = SessionSelectionClose(app, self)
self.detach = SessionSelectionDetach(app, self)
Modified: branches/scale_testing/cumin/python/cumin/messaging/exchange.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/messaging/exchange.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/messaging/exchange.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -79,6 +79,7 @@
self.add_attribute_column(cls.byteRoutes)
self.add_reference_filter(vhost, cls.vhostRef)
+ self.add_search_filter(cls.name)
self.remove = ExchangeSelectionRemove(app, self)
Modified: branches/scale_testing/cumin/python/cumin/messaging/queue.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/messaging/queue.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/messaging/queue.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -79,6 +79,7 @@
self.add_attribute_column(cls.byteDepth)
self.add_reference_filter(vhost, cls.vhostRef)
+ self.add_search_filter(cls.name)
self.remove = QueueSelectionRemove(app, self)
self.purge = QueueSelectionPurge(app, self)
Modified: branches/scale_testing/cumin/python/cumin/messaging/subscription.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/messaging/subscription.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/messaging/subscription.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -21,6 +21,8 @@
self.add_attribute_column(cls.arguments)
self.add_attribute_column(cls.delivered)
+ self.add_search_filter(cls.name)
+
class SubscriptionFrame(ObjectFrame):
def __init__(self, app, name):
cls = app.model.org_apache_qpid_broker.Subscription
Modified: branches/scale_testing/cumin/python/cumin/model.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/model.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/model.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -82,6 +82,7 @@
try:
try:
store = self.group_names_by_negotiator[negotiator._qmf_agent_id]
+ store.extend_updates()
except KeyError:
store = NegotiatorGroupNamesStore(self, negotiator)
store.start_updates()
@@ -101,6 +102,7 @@
try:
try:
store = self.group_config_values_by_negotiator[negotiator._qmf_agent_id]
+ store.extend_updates()
added = 0
for group in needed_groups:
added += store.add_group_config(group, config)
@@ -139,6 +141,7 @@
try:
try:
store = self.limits_by_negotiator[negotiator._qmf_agent_id]
+ store.extend_updates()
except KeyError:
store = NegotiatorLimitStore(self, negotiator)
store.start_updates()
@@ -159,6 +162,7 @@
try:
try:
store = self.job_summaries_by_submission[submission._id]
+ store.extend_updates()
except KeyError:
store = SubmissionJobSummaryStore(self, submission)
store.start_updates()
@@ -667,189 +671,6 @@
self.ad_properties.append(prop)
self.ad_properties_by_name[prop.name] = prop
-class CuminClass(object):
- def __init__(self, model, name, mint_class):
- self.model = model
- self.cumin_name = name
- self.mint_class = mint_class
-
- self.properties = list()
- self.ad_properties = list()
- self.ad_properties_by_name = dict()
- self.stats = list()
- self.actions = list()
-
- self.tasks = list()
- self.tasks_by_class = dict()
-
- self.frame = None
-
- self.model.add_class(self)
-
- def add_property(self, prop):
- self.properties.append(prop)
- setattr(self, prop.name, prop)
-
- def add_ad_property(self, prop):
- self.ad_properties.append(prop)
- self.ad_properties_by_name[prop.name] = prop
-
- def add_stat(self, stat):
- self.stats.append(stat)
- setattr(self, stat.name, stat)
-
- def add_action(self, action):
- self.actions.append(action)
- setattr(self, action.name, action)
-
- def add_task(self, task):
- self.tasks.append(task)
- self.tasks_by_class[task.__class__] = task
-
- def init(self):
- log.debug("Initializing class %s", self)
-
- for prop in self.properties:
- prop.init()
-
- for ad_prop in self.ad_properties:
- ad_prop.init()
-
- for stat in self.stats:
- stat.init()
-
- for action in self.actions:
- action.init()
-
- for task in self.tasks:
- log.debug("Initializing task %s", task)
- task.init()
-
- def get_title(self, session):
- return "Object"
-
- def get_plural_title(self, session):
- return self.get_title(session) + "s"
-
- def get_icon_href(self, session):
- return "resource?name=action-36.png"
-
- def get_object_href(self, session, object):
- branch = session.branch()
- self.show_object(branch, object)
- return branch.marshal()
-
- def get_object_href_by_id(self, session, id):
- return self.get_object_href(session, Identifiable(id))
-
- def show_object(self, session, object):
- return self.frame.show_object(session, object)
-
- def get_object_title(self, session, object):
- title = self.get_title(session)
- name = self.get_object_name(object)
- return "%s '%s'" % (title, name)
-
- def get_object_name(self, object):
- return object.name
-
- def write_event_xml(self, writer, object):
- writer.write("<events errors=\"%i\" warnings=\"%i\"/>" % (0, 0))
-
- def write_stat_xml(self, session, writer, object):
- for stat in self.stats:
- stat.write_xml(writer, object)
-
- def write_xml(self, session, writer, object):
- object.sync()
-
- writer.write("<%s id=\"%s\" name=\"%s\">" % \
- (self.cumin_name, str(object.id),
- self.get_object_name(object)))
-
- self.write_event_xml(writer, object)
- self.write_stat_xml(session, writer, object)
-
- writer.write("</%s>" % self.cumin_name)
-
- def __str__(self):
- return "%s.%s" % (self.__module__, self.__class__.__name__)
-
-class RemoteClass(CuminClass):
- def __init__(self, model, name, mint_class, mint_stats_class):
- super(RemoteClass, self).__init__(model, name, mint_class)
-
- self.mint_stats_class = mint_stats_class
-
- prop = CuminProperty(self, "qmfObjectId")
- prop.title = "Management ID"
-
- prop = CuminProperty(self, "qmfCreateTime")
- prop.title = "Creation Time"
-
- prop = CuminProperty(self, "qmfDeleteTime")
- prop.title = "Deletion Time"
-
- prop = CuminProperty(self, "qmfUpdateTime")
- prop.title = "Last Updated"
- prop.summary = True
-
-class CuminGrid(RemoteClass):
- def __init__(self, model):
- super(CuminGrid, self).__init__(model, "grid", Grid, GridStats)
-
- prop = CuminProperty(self, "Name")
- prop.title = "Name"
-
- prop = CuminProperty(self, "Pool")
- prop.title = "Pool"
-
- prop = CuminProperty(self, "JobLimit")
- prop.title = "Job Limit"
-
- prop = CuminProperty(self, "SubmitLimit")
- prop.title = "Submit Limit"
-
- prop = CuminProperty(self, "GridResourceUnavailableTime")
- prop.title = "Grid Resource Unavailable Time"
-
- stat = CuminStat(self, "NumJobs")
- stat.title = "Num Jobs"
- stat.category = "general"
-
- stat = CuminStat(self, "SubmitsInProgress")
- stat.title = "Submits In Progress"
- stat.category = "general"
-
- stat = CuminStat(self, "SubmitsQueued")
- stat.title = "Submits Queued"
- stat.category = "general"
-
- stat = CuminStat(self, "SubmitsAllowed")
- stat.title = "Submits Allowed"
- stat.category = "general"
-
- stat = CuminStat(self, "SubmitsWanted")
- stat.title = "Submits Wanted"
- stat.category = "general"
-
- stat = CuminStat(self, "RunningJobs")
- stat.title = "Running Jobs"
- stat.category = "general"
-
- stat = CuminStat(self, "IdleJobs")
- stat.title = "Idle Jobs"
- stat.category = "general"
-
- def init(self):
- super(CuminGrid, self).init()
-
- def get_title(self, session):
- return "Grid"
-
- def get_icon_href(self, session):
- return "resource?name=pool-36.png"
-
# XXX "do_" on this doesn't make sense
def do_bind(session, queue_name, binding_info):
for exchange in binding_info:
@@ -863,573 +684,6 @@
binding_key=binding_key,
arguments=binding_info[exchange]["arguments"])
-class CuminQueue(RemoteClass):
- def __init__(self, model):
- super(CuminQueue, self).__init__(model, "queue", Queue, QueueStats)
-
- prop = CuminProperty(self, "name")
- prop.title = "Name"
-
- prop = CuminProperty(self, "durable")
- prop.title = "Durable?"
- prop.summary = True
-
- prop = CuminProperty(self, "autoDelete")
- prop.title = "Auto Delete?"
- prop.summary = True
-
- prop = CuminProperty(self, "exclusive")
- prop.title = "Exclusive?"
- prop.summary = True
-
- prop = CuminProperty(self, "arguments")
- prop.title = "Arguments"
- prop.prefix = "qpid."
- prop.escape = False
-
- stat = CuminStat(self, "consumerCount")
- stat.title = "Consumers"
- stat.unit = "consumer"
- stat.highlow = True
-
- stat = CuminStat(self, "bindingCount")
- stat.title = "Bindings"
- stat.unit = "binding"
- stat.highlow = True
-
- stat = CuminStat(self, "msgDepth")
- stat.title = "Message Depth"
- stat.highlow = True
-
- stat = CuminStat(self, "msgTotalEnqueues")
- stat.title = "Msgs. Enqueued"
- stat.unit = "message"
- stat.category = "io"
-
- stat = CuminStat(self, "msgTotalDequeues")
- stat.title = "Msgs. Dequeued"
- stat.unit = "message"
- stat.category = "io"
-
- stat = CuminStat(self, "byteDepth")
- stat.title = "Byte Depth"
- stat.unit = "byte"
- stat.highlow = True
-
- stat = CuminStat(self, "byteTotalEnqueues")
- stat.title = "Bytes Enqueued"
- stat.unit = "byte"
- stat.category = "io"
-
- stat = CuminStat(self, "byteTotalDequeues")
- stat.title = "Bytes Dequeued"
- stat.unit = "byte"
- stat.category = "io"
-
- stat = CuminStat(self, "unackedMessages")
- stat.title = "Msgs. Unacked"
- stat.unit = "message"
- stat.category = "io"
- stat.highlow = True
-
- stat = CuminStat(self, "messageLatencyMin")
- stat.title = "Min. Msg. Latency"
- stat.unit = "nanosecond"
- stat.category = "io"
-
- stat = CuminStat(self, "messageLatencyMax")
- stat.title = "Max. Msg. Latency"
- stat.unit = "nanosecond"
- stat.category = "io"
-
- stat = CuminStat(self, "messageLatencyAverage")
- stat.title = "Avg. Msg. Latency"
- stat.unit = "nanosecond"
- stat.category = "io"
-
- # Transactional
-
- stat = CuminStat(self, "msgTxnEnqueues")
- stat.title = "Msgs. Enqueued"
- stat.unit = "message"
- stat.category = "io.txn"
-
- stat = CuminStat(self, "msgTxnDequeues")
- stat.title = "Msgs. Dequeued"
- stat.unit = "message"
- stat.category = "io.txn"
-
- stat = CuminStat(self, "byteTxnEnqueues")
- stat.title = "Bytes Enqueued"
- stat.unit = "byte"
- stat.category = "io.txn"
-
- stat = CuminStat(self, "byteTxnDequeues")
- stat.title = "Bytes Dequeued"
- stat.unit = "byte"
- stat.category = "io.txn"
-
- stat = CuminStat(self, "enqueueTxnStarts")
- stat.title = "Enq. Trans. Started"
- stat.unit = "transaction"
- stat.category = "txn"
-
- stat = CuminStat(self, "enqueueTxnCommits")
- stat.title = "Enq. Trans. Committed"
- stat.unit = "transaction"
- stat.category = "txn"
-
- stat = CuminStat(self, "enqueueTxnRejects")
- stat.title = "Enq. Trans. Rejected"
- stat.unit = "transaction"
- stat.category = "txn"
-
- stat = CuminStat(self, "enqueueTxnCount")
- stat.title = "Enq. Trans. Pending"
- stat.unit = "transaction"
- stat.category = "txn"
- stat.highlow = True
-
- stat = CuminStat(self, "dequeueTxnStarts")
- stat.title = "Deq. Trans. Started"
- stat.unit = "transaction"
- stat.category = "txn"
-
- stat = CuminStat(self, "dequeueTxnCommits")
- stat.title = "Deq. Trans. Committed"
- stat.unit = "transaction"
- stat.category = "txn"
-
- stat = CuminStat(self, "dequeueTxnRejects")
- stat.title = "Deq. Trans. Rejected"
- stat.unit = "transaction"
- stat.category = "txn"
-
- stat = CuminStat(self, "dequeueTxnCount")
- stat.title = "Deq. Trans. Pending"
- stat.unit = "transaction"
- stat.category = "txn"
- stat.highlow = True
-
- # Durable
-
- stat = CuminStat(self, "msgPersistEnqueues")
- stat.title = "Msgs. Enqueued"
- stat.unit = "message"
- stat.category = "io.durable"
-
- stat = CuminStat(self, "msgPersistDequeues")
- stat.title = "Msgs. Dequeued"
- stat.unit = "message"
- stat.category = "io.durable"
-
- stat = CuminStat(self, "bytePersistEnqueues")
- stat.title = "Bytes Enqueued"
- stat.unit = "byte"
- stat.category = "io.durable"
-
- stat = CuminStat(self, "bytePersistDequeues")
- stat.title = "Bytes Dequeued"
- stat.unit = "byte"
- stat.category = "io.durable"
-
- def init(self):
- super(CuminQueue, self).init()
-
- self.frame = self.model.frame.messaging.broker.queue
-
- def get_title(self, session):
- return "Queue"
-
- def get_icon_href(self, session):
- return "resource?name=queue-36.png"
-
-class CuminExchange(RemoteClass):
- def __init__(self, model):
- super(CuminExchange, self).__init__(model, "exchange",
- Exchange, ExchangeStats)
-
- prop = self.NameProperty(self, "name")
- prop.title = "Name"
-
- prop = CuminProperty(self, "type")
- prop.title = "Type"
- prop.summary = True
-
- prop = CuminProperty(self, "durable")
- prop.title = "Durable?"
- prop.summary = True
-
- prop = CuminProperty(self, "arguments")
- prop.title = "Arguments"
- prop.prefix = "qpid."
- prop.escape = False
-
- stat = CuminStat(self, "producerCount")
- stat.title = "Producers"
- stat.unit = "producer"
- stat.highlow = True
-
- stat = CuminStat(self, "bindingCount")
- stat.title = "Bindings"
- stat.unit = "binding"
- stat.highlow = True
-
- stat = CuminStat(self, "msgReceives")
- stat.title = "Msgs. Received"
- stat.unit = "message"
- stat.category = "io"
-
- stat = CuminStat(self, "msgRoutes")
- stat.title = "Msgs. Routed"
- stat.unit = "message"
- stat.category = "io"
-
- stat = CuminStat(self, "msgDrops")
- stat.title = "Msgs. Dropped"
- stat.unit = "message"
- stat.category = "io"
-
- stat = CuminStat(self, "byteReceives")
- stat.title = "Bytes Received"
- stat.unit = "message"
- stat.category = "io"
-
- stat = CuminStat(self, "byteRoutes")
- stat.title = "Bytes Routed"
- stat.unit = "message"
- stat.category = "io"
-
- stat = CuminStat(self, "byteDrops")
- stat.title = "Bytes Dropped"
- stat.unit = "message"
- stat.category = "io"
-
- def init(self):
- super(CuminExchange, self).init()
-
- self.frame = self.model.frame.messaging.broker.exchange
-
- def get_title(self, session):
- return "Exchange"
-
- def get_icon_href(self, session):
- return "resource?name=exchange-36.png"
-
- def get_object_title(self, session, object):
- name = super(CuminExchange, self).get_object_name(object)
-
- if name:
- return super(CuminExchange, self).get_object_title(session, object)
- else:
- return self.get_object_name(object)
-
- def get_object_name(self, object):
- return object.name and object.name or "Default Exchange"
-
- class NameProperty(CuminProperty):
- def value(self, session, object):
- value = getattr(object, self.name, None)
- return value and value or "Default Exchange"
-
-class CuminBinding(RemoteClass):
- def __init__(self, model):
- super(CuminBinding, self).__init__(model, "binding",
- Binding, BindingStats)
-
- prop = CuminProperty(self, "bindingKey")
- prop.title = "Binding Key"
-
- stat = CuminStat(self, "msgMatched")
- stat.title = "Msgs. Matched"
- stat.unit = "message"
-
- def get_title(self, session):
- return "Binding"
-
- def get_object_name(self, binding):
- return "between %s and %s" % (binding.exchange.name, binding.queue.name)
-
-class CuminRoute(RemoteClass):
- def __init__(self, model):
- super(CuminRoute, self).__init__ \
- (model, "route", Bridge, BridgeStats)
-
- prop = CuminProperty(self, "key")
- prop.title = "Route Key"
-
- prop = CuminProperty(self, "tag")
- prop.title = "Tag"
-
- prop = CuminProperty(self, "excludes")
- prop.title = "Excludes"
-
- prop = CuminProperty(self, "durable")
- prop.title = "Durable"
-
- prop = CuminProperty(self, "dest")
- prop.title = "Exchange"
-
- def get_title(self, session):
- return "Route"
-
- def get_object_name(self, route):
- return route.src
-
-class CuminConnection(RemoteClass):
- def __init__(self, model):
- super(CuminConnection, self).__init__(model, "connection",
- ClientConnection,
- ClientConnectionStats)
-
- prop = CuminProperty(self, "address")
- prop.title = "Address"
-
- prop = CuminProperty(self, "SystemConnection")
- prop.title = "System Connection?"
-
- prop = CuminProperty(self, "authIdentity")
- prop.title = "Auth Identity?"
-
- prop = CuminProperty(self, "federationLink")
- prop.title = "Federation Link"
-
- stat = CuminStat(self, "closing")
- stat.title = "Closing Down"
- stat.category = "general"
-
- stat = CuminStat(self, "bytesFromClient")
- stat.title = "Bytes Sent"
- stat.unit = "byte"
- stat.category = "io"
-
- stat = CuminStat(self, "bytesToClient")
- stat.title = "Bytes Received"
- stat.unit = "byte"
- stat.category = "io"
-
- stat = CuminStat(self, "framesFromClient")
- stat.title = "Frames Sent"
- stat.unit = "frame"
- stat.category = "io"
-
- stat = CuminStat(self, "framesToClient")
- stat.title = "Frames Received"
- stat.unit = "frame"
- stat.category = "io"
-
- def init(self):
- super(CuminConnection, self).init()
-
- self.frame = self.model.frame.messaging.broker.connection
-
- def get_title(self, session):
- return "Connection"
-
- def get_icon_href(self, session):
- return "resource?name=client-36.png"
-
- def get_object_name(self, conn):
- return conn.address
-
-class CuminLink(RemoteClass):
- def __init__(self, model):
- super(CuminLink, self).__init__(model, "link", Link, LinkStats)
-
- prop = CuminProperty(self, "useSsl")
- prop.title = "Use SSL"
- prop.summary = True
-
- prop = CuminProperty(self, "durable")
- prop.title = "Durable"
- prop.summary = True
-
- stat = CuminStat(self, "closing")
- stat.title = "Closing Down"
-
- stat = CuminStat(self, "framesFromPeer")
- stat.title = "Frames from Peer"
- stat.unit = "frame"
- stat.category = "io"
-
- stat = CuminStat(self, "framesToPeer")
- stat.title = "Frames to Peer"
- stat.unit = "frame"
- stat.category = "io"
-
- stat = CuminStat(self, "bytesFromPeer")
- stat.title = "Bytes from Peer"
- stat.unit = "byte"
- stat.category = "io"
-
- stat = CuminStat(self, "bytesToPeer")
- stat.title = "Bytes to Peer"
- stat.unit = "byte"
- stat.category = "io"
-
- def get_title(self, session):
- return "Broker Link"
-
- def get_object_name(self, link):
- return "%s:%d" % (link.host, link.port)
-
-class CuminBrokerStoreModule(RemoteClass):
- def __init__(self, model):
- super(CuminBrokerStoreModule, self).__init__ \
- (model, "store", Store, StoreStats)
-
- prop = CuminProperty(self, "location")
- prop.title = "Location"
-
-class CuminJournal(RemoteClass):
- def __init__(self, model):
- super(CuminJournal, self).__init__(model, "journal",
- Journal, JournalStats)
-
- prop = CuminProperty(self, "name")
- prop.title = "Name"
- prop.summary = True
-
- prop = CuminProperty(self, "directory")
- prop.title = "Directory"
-
- stat = CuminStat(self, "initialFileCount")
- stat.title = "Initial File Count"
- stat.unit = "file"
- stat.category = "io.journal"
-
- stat = CuminStat(self, "dataFileSize")
- stat.title = "Data File Size"
- stat.unit = "byte"
- stat.category = "io.journal"
-
- stat = CuminStat(self, "recordDepth")
- stat.title = "Record Depth"
- stat.unit = "record"
- stat.category = "io.journal"
-
- stat = CuminStat(self, "recordEnqueues")
- stat.title = "Record Enqueues"
- stat.unit = "record"
- stat.category = "io.journal"
-
- stat = CuminStat(self, "outstandingAIOs")
- stat.title = "Outstanding AIOs"
- stat.unit = "aio"
- stat.category = "io.journal"
-
- stat = CuminStat(self, "freeFileCount")
- stat.title = "Free Files"
- stat.unit = "file"
- stat.category = "io.journal"
-
- stat = CuminStat(self, "availableFileCount")
- stat.title = "Avail. Files"
- stat.unit = "file"
- stat.category = "io.journal"
-
- stat = CuminStat(self, "writeWaitFailures")
- stat.title = "Write Wait Failures"
- stat.unit = "failure"
- stat.category = "io.journal"
-
- stat = CuminStat(self, "writeBusyFailures")
- stat.title = "Write Busy Failures"
- stat.unit = "failure"
- stat.category = "io.journal"
-
- stat = CuminStat(self, "readRecordCount")
- stat.title = "Read Records"
- stat.unit = "record"
- stat.category = "io.journal"
-
- stat = CuminStat(self, "readBusyFailures")
- stat.title = "Read Busy Failures"
- stat.unit = "failure"
- stat.category = "io.journal"
-
- stat = CuminStat(self, "writePageCacheDepth")
- stat.title = "Write Page Cache Depth"
- stat.unit = "page"
- stat.category = "io.journal"
-
- stat = CuminStat(self, "readPageCacheDepth")
- stat.title = "Read Page Cache Depth"
- stat.unit = "page"
- stat.category = "io.journal"
-
-class CuminBrokerAclModule(RemoteClass):
- def __init__(self, model):
- super(CuminBrokerAclModule, self).__init__ \
- (model, "store", Acl, AclStats)
-
- prop = CuminProperty(self, "policyFile")
- prop.title = "Policy File"
-
- prop = CuminProperty(self, "enforcingAcl")
- prop.title = "Enforcing?"
-
- prop = CuminProperty(self, "transferAcl")
- prop.title = "Transfer?"
-
- prop = CuminProperty(self, "lastAclLoad")
- prop.title = "Last Loaded"
-
- stat = CuminStat(self, "aclDenyCount")
- stat.title = "Denials"
- stat.unit = "denial"
-
-class CuminBrokerClusterModule(RemoteClass):
- def __init__(self, model):
- super(CuminBrokerClusterModule, self).__init__ \
- (model, "broker_cluster_module", Cluster, ClusterStats)
-
- prop = CuminProperty(self, "clusterName")
- prop.title = "Name"
-
- prop = CuminProperty(self, "clusterID")
- prop.title = "ID"
-
- prop = CuminProperty(self, "publishedURL")
- prop.title = "URL"
-
- prop = CuminProperty(self, "clusterSize")
- prop.title = "Size"
-
- prop = CuminProperty(self, "status")
- prop.title = "Status"
-
- prop = CuminProperty(self, "members")
- prop.title = "Members"
-
-class CuminLimit(CuminClass):
- def __init__(self, model):
- super(CuminLimit, self).__init__ \
- (model, "limit", None)
-
- prop = CuminProperty(self, "name")
- prop.title = "Name"
-
- prop = CuminProperty(self, "curr")
- prop.summary = True
- prop.title = "Current"
-
- prop = CuminProperty(self, "max")
- prop.summary = True
- prop.title = "Maximum"
-
- def init(self):
- super(CuminLimit, self).init()
-
- #self.frame = self.model.frame.grid.pool.limit
-
- def get_title(self, session):
- return "Concurrency Limit"
-
- def get_object_title(self, session, limit):
- title = self.get_title(session)
- return "%s '%s'" % (title, limit)
-
class JobMetaData(MetaData):
def __init__(self, name):
super(JobMetaData, self).__init__(name)
@@ -1759,232 +1013,6 @@
log.exception(e)
return self.do_wait()
-class CuminScheduler(RemoteClass):
- def __init__(self, model):
- super(CuminScheduler, self).__init__(model, "scheduler",
- Scheduler, SchedulerStats)
-
- prop = CuminProperty(self, "Name")
- prop.title = "Name"
-
- prop = CuminProperty(self, "JobQueueBirthdate")
- prop.title = "Job Queue Birthdate"
-
- prop = CuminProperty(self, "MaxJobsRunning")
- prop.title = "Max Jobs Running"
-
- prop = CuminProperty(self, "MyAddress")
- prop.title = "Contact Address"
-
- prop = CuminProperty(self, "PublicNetworkIpAddr")
- prop.title = "Public IP Address"
-
- prop = CuminProperty(self, "Machine")
- prop.title = "Machine"
- prop.summary = True
-
- prop = CuminProperty(self, "System")
- prop.title = "System"
-
- stat = CuminStat(self, "NumUsers")
- stat.title = "Users"
-
- stat = CuminStat(self, "TotalRunningJobs")
- stat.title = "Running Jobs"
-
- stat = CuminStat(self, "TotalIdleJobs")
- stat.title = "Idle Jobs"
-
- stat = CuminStat(self, "TotalHeldJobs")
- stat.title = "Held Jobs"
-
- stat = CuminStat(self, "TotalJobAds")
- stat.title = "Job Ads"
-
- stat = CuminStat(self, "TotalRemovedJobs")
- stat.title = "Removed Jobs"
-
- action = GetStartedAction(self, "GetStarted")
- action.navigable = False
-
- def init(self):
- super(CuminScheduler, self).init()
-
- # self.frame = self.model.frame.grid.pool.scheduler
-
- def get_title(self, session):
- return "Scheduler"
-
- def get_object_name(self, sched):
- return sched.Name
-
-class CuminSubmission(RemoteClass):
- def __init__(self, model):
- super(CuminSubmission, self).__init__(model, "submission",
- Submission, SubmissionStats)
-
- prop = CuminProperty(self, "Name")
- prop.title = "Name"
-
- stat = CuminStat(self, "Idle")
- stat.title = "Idle Jobs"
-
- stat = CuminStat(self, "Running")
- stat.title = "Running Jobs"
-
- stat = CuminStat(self, "Removed")
- stat.title = "Removed Jobs"
-
- stat = CuminStat(self, "Completed")
- stat.title = "Completed Jobs"
-
- stat = CuminStat(self, "Held")
- stat.title = "Held Jobs"
-
- def get_title(self, session):
- return "Submission"
-
- def get_object_name(self, sub):
- return sub.Name
-
-class CuminSubmitter(RemoteClass):
- def __init__(self, model):
- super(CuminSubmitter, self).__init__(model, "submitter",
- Submitter, SubmitterStats)
-
- prop = CuminProperty(self, "Name")
- prop.title = "Name"
-
- stat = CuminStat(self, "RunningJobs")
- stat.title = "Running Jobs"
-
- stat = CuminStat(self, "IdleJobs")
- stat.title = "Idle Jobs"
-
- stat = CuminStat(self, "HeldJobs")
- stat.title = "Held Jobs"
-
- def init(self):
- super(CuminSubmitter, self).init()
-
- #self.frame = self.model.frame.grid.pool.scheduler.submitter
-
- def get_title(self, session):
- return "Submitter"
-
- def get_object_name(self, sub):
- return sub.Name
-
- def show_object(self, session, sub):
- pool = self.model.get_main_pool()
-
- assert pool
-
- self.model.frame.grid.pool.set_object(session, pool)
-
- return self.frame.show_object(session, sub)
-
-class CuminCollector(RemoteClass):
- def __init__(self, model):
- super(CuminCollector, self).__init__(model, "collector",
- Collector, CollectorStats)
-
- prop = CuminProperty(self, "Name")
- prop.title = "Name"
-
- prop = CuminProperty(self, "PublicNetworkIpAddr")
- prop.title = "IP Address"
-
- action = GetStartedAction(self, "GetStarted")
- action.navigable = False
-
- stat = CuminStat(self, "RunningJobs")
- stat.title = "Running Jobs"
-
- stat = CuminStat(self, "IdleJobs")
- stat.title = "Idle Jobs"
-
- stat = CuminStat(self, "HostsClaimed")
- stat.title = "Claimed Slots"
-
- stat = CuminStat(self, "HostsUnclaimed")
- stat.title = "Unclaimed Slots"
-
- stat = CuminStat(self, "HostsOwner")
- stat.title = "Owner Slots"
-
- stat = CuminStat(self, "HostsTotal")
- stat.title = "Total Slots"
-
- def init(self):
- super(CuminCollector, self).init()
-
- #self.frame = self.model.frame.grid.pool.collector
-
- def get_title(self, session):
- return "Collector"
-
- def get_object_name(self, coll):
- return coll.Name
-
-class CuminNegotiator(RemoteClass):
- def __init__(self, model):
- super(CuminNegotiator, self).__init__(model, "negotiator",
- Negotiator, NegotiatorStats)
-
- prop = CuminProperty(self, "Name")
- prop.title = "Name"
-
- prop = CuminProperty(self, "Machine")
- prop.title = "Machine"
-
- prop = CuminProperty(self, "MyAddress")
- prop.title = "Address"
-
- prop = CuminProperty(self, "DaemonStartTime")
- prop.title = "Start Time"
-
- stat = CuminStat(self, "MonitorSelfAge")
- stat.title = "Age"
- stat.category = "general"
-
- stat = CuminStat(self, "MonitorSelfCPUUsage")
- stat.title = "CPU Usage"
- stat.category = "general"
-
- stat = CuminStat(self, "MonitorSelfImageSize")
- stat.title = "Image Size"
- stat.category = "general"
-
- stat = CuminStat(self, "MonitorSelfRegisteredSocketCount")
- stat.title = "Registered Socket Count"
- stat.category = "general"
-
- stat = CuminStat(self, "MonitorSelfResidentSetSize")
- stat.title = "Resident Set Size"
- stat.category = "general"
-
- action = GetStartedAction(self, "GetStarted")
- action.navigable = False
-
- def init(self):
- super(CuminNegotiator, self).init()
-
- #self.frame = self.model.frame.grid.pool.negotiator
-
- def get_title(self, session):
- return "Negotiator"
-
- def get_object_name(self, neg):
- return neg.Name
-
-class CuminSubject(CuminClass):
- def __init__(self, model):
- super(CuminSubject, self).__init__(model, "subject", Subject)
-
- def get_title(self, session):
- return "Subject"
-
class Pool(object):
def __init__(self, id):
self.id = id
@@ -2013,6 +1041,9 @@
def start_updates(self):
self.update_thread.start()
+ def extend_updates(self):
+ self.update_thread.extend()
+
def update(self):
pass
@@ -2025,13 +1056,19 @@
self.store = store
self.setDaemon(True)
+ self.ticks = 0
+ def extend(self):
+ # if we get a request for this object's info
+ # keep polling for another 10 minutes
+ self.ticks = 0
+
def run(self):
conn = self.store.model.app.database.get_connection()
cursor = conn.cursor()
try:
- for i in range(20):
+ while self.ticks < 20:
try:
self.store.update(cursor)
self.store.exception = None
@@ -2039,6 +1076,7 @@
log.exception(e)
self.store.exception = e
+ self.ticks += 1
sleep(30)
finally:
conn.close()
Modified: branches/scale_testing/cumin/python/cumin/objectselector.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/objectselector.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/objectselector.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -73,7 +73,7 @@
self.add_filter(attribute, this, that)
- def add_like_filter(self, attribute, this, type=SqlLikeFilter.BEGINS):
+ def add_like_filter(self, attribute, this, type=SqlLikeFilter.CONTAINS):
assert isinstance(attribute, Attribute), attribute
assert isinstance(this, RosemaryAttribute), this
@@ -88,8 +88,14 @@
for this, vattr, type in self.like_specs:
value = vattr.get(session)
- pre = type == SqlLikeFilter.CONTAINS and "%%" or ""
- values[this.name] = "%s%s%%" % (pre, value)
+ # if the user typed a %, don't add another
+ pre = ""
+ post = "%"
+ if not "%" in value:
+ pre = type == SqlLikeFilter.CONTAINS and "%%" or ""
+ else:
+ post = ""
+ values[this.name] = "%s%s%s" % (pre, value, post)
return values
@@ -119,11 +125,12 @@
else:
self.field = ObjectSqlField(self.table.adapter, self.attr)
-class ObjectSelector(ObjectTable, Form):
+class ObjectSelector(Form):
def __init__(self, app, name, cls):
- super(ObjectSelector, self).__init__(app, name, cls)
+ super(ObjectSelector, self).__init__(app, name)
- self.init_ids(app, cls)
+ self.update_enabled = False
+ self.cls = cls
self.switches = ObjectSelectorSwitches(app, "switches")
self.add_child(self.switches)
@@ -137,6 +144,9 @@
self.links = ObjectSelectorLinks(app, "links")
self.add_child(self.links)
+ self.table = self.create_table(app, "table", cls)
+ self.add_child(self.table)
+
self.tasks = list()
def init(self):
@@ -150,6 +160,47 @@
self.buttons.add_child(button)
button.init()
+ def create_table(self, app, name, cls):
+ return ObjectSelectorTable(app, name, cls)
+
+ def add_search_filter(self, this):
+ search = StringInput(self.app, "search")
+ search.param.default = ""
+
+ self.table.add_like_filter(search.param, this)
+ self.filters.add_child(search)
+
+ def add_filter(self, attribute, this, that=None):
+ self.table.add_filter(attribute, this, that)
+
+ def add_column(self, col):
+ self.table.add_column(col)
+
+ def add_attribute_column(self, attr):
+ self.table.add_attribute_column(attr)
+
+ def add_reference_filter(self, attribute, ref):
+ self.table.add_reference_filter(attribute, ref)
+
+ def insert_column(self, index, column):
+ self.table.insert_column(index, column)
+
+ def render_title(self, session):
+ return self.table.render_title(session)
+
+ def get_data_values(self, session):
+ return self.table.get_data_values(session)
+
+ def get_data_options(self, session):
+ return self.table.get_data_options(session)
+
+class ObjectSelectorTable(ObjectTable):
+ def __init__(self, app, name, cls):
+ super(ObjectSelectorTable, self).__init__(app, name, cls)
+
+ self.update_enabled = True
+ self.init_ids(app, cls)
+
def init_ids(self, app, cls):
item = IntegerParameter(app, "item")
@@ -179,7 +230,10 @@
self.width = "1%"
def render_cell_value(self, session, record):
- return record[self.field.index]
+ try:
+ return record[self.field.index]
+ except IndexError:
+ return 0
class ObjectCheckboxColumnInput(CheckboxColumnInput):
def render_onclick_attr(self, session, record):
@@ -189,6 +243,8 @@
return "onclick=\"%s\"" % value
def render_checked_attr(self, session, record):
+ if len(record) == 0:
+ return ""
checks = self.get(session)
return record[self.parent.parent.field.index] in checks \
and "checked=\"checked\"" or ""
@@ -221,7 +277,7 @@
return frame.get_href(session, Identifiable(id)) # XXX
def render_cell_content(self, session, record):
- return record[self.field.index]
+ return len(record) > 0 and record[self.field.index] or ""
class ObjectSelectorControl(WidgetSet):
def do_render(self, session):
@@ -262,7 +318,7 @@
pass
def enter(self, session):
- ids = self.selector.ids.get(session)
+ ids = self.selector.table.ids.get(session)
nsession = wooly.Session(self.app.form_page)
@@ -345,3 +401,12 @@
def render_item_class(self, session, item):
return "item"
+
+class MonitorSelfStatColumn(ObjectTableColumn):
+ def render_header_content(self, session):
+ title = self.field.get_title(session)
+ parts = title.split()
+ if len(parts) > 2:
+ if parts[0] == "Monitor" and parts[1] == "Self":
+ return " ".join(parts[2:])
+ return title
Modified: branches/scale_testing/cumin/python/cumin/objectselector.strings
===================================================================
--- branches/scale_testing/cumin/python/cumin/objectselector.strings 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/objectselector.strings 2011-01-05 15:18:06 UTC (rev 4449)
@@ -7,8 +7,18 @@
div.ObjectSelectorFilters {
float: right;
+ padding-bottom: 0.25em;
}
+div.ObjectSelectorFilters ul {
+ float: left;
+ margin: 0;
+}
+
+div.ObjectSelectorFilters input {
+ font-size: 0.75em;
+}
+
div.ObjectSelectorButtons {
background-color: #e7e7f7;
padding: 0.35em 0.75em;
@@ -31,14 +41,22 @@
[ObjectSelector.html]
<div id="{id}" class="{class}">
{links}
-
- {filters}
-
{switches}
- <form method="post" action="?">
+ <form id="{id}.form" method="post" action="?">
+ {filters}
{buttons}
+ {table}
+
+ <div>{hidden_inputs}</div>
+ </form>
+ <script type="text/javascript">
+ cumin.restoreTableCheckboxes();
+ </script>
+</div>
+
+[ObjectSelectorTable.html]
<table id="{id}" class="{class}">
<style type="text/css">
{css}
@@ -48,14 +66,6 @@
<tbody>{rows}</tbody>
</table>
- <div>{hidden_inputs}</div>
- </form>
-
- <script type="text/javascript">
- cumin.restoreTableCheckboxes();
- </script>
-</div>
-
[ObjectSelectorControl.html]
<div class="{class}">
<ul>{widgets}</ul>
@@ -67,3 +77,9 @@
<ul>{widgets}</ul>
</div>
+
+[ObjectSelectorFilters.html]
+<div class="{class}">
+ <ul>{widgets}</ul>
+ <input type="submit" value="Search"/>
+</div><div style="clear:both;"></div>
Modified: branches/scale_testing/cumin/python/cumin/qmfadapter.py
===================================================================
--- branches/scale_testing/cumin/python/cumin/qmfadapter.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/cumin/python/cumin/qmfadapter.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -94,6 +94,10 @@
self.fields_by_attr = dict()
+ def add_like_filter(self, attr):
+ #TODO: add sql LIKE filtering to QMF results
+ pass
+
class QmfField(DataAdapterField):
def __init__(self, adapter, column):
python_type = column.type.python_type
@@ -104,7 +108,6 @@
self.adapter.columns.append(column)
-
class ObjectQmfField(QmfField):
def __init__(self, adapter, attr):
assert isinstance(adapter, ObjectQmfAdapter), adapter
Modified: branches/scale_testing/mint/python/mint/update.py
===================================================================
--- branches/scale_testing/mint/python/mint/update.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/mint/python/mint/update.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -129,7 +129,6 @@
self.time = None
self.cpu = 0
self.memory = 0
-
self.init_update_times()
def init_update_times(self):
@@ -141,6 +140,7 @@
self.initial_process_time = 0
self.commit_time = 0
self.record_samples = 0
+ self.depth = 0
self.init_update_flag = False
def record_update_times(self,update):
@@ -158,6 +158,8 @@
update.after_process - update.start_process
self.commit_time += \
update.after_commit - update.after_process
+ self.depth += \
+ self.enqueued - self.dequeued
except:
print "record update exception"
print_exc()
@@ -274,20 +276,23 @@
def get_update_durations(self):
total = self.now.record_samples
if total == 0 or self.now.dequeued == self.then.dequeued:
- create_dur = proc_dur = que_dur = init_proc_time = commit_time = 0
+ create_dur = proc_dur = que_dur = init_proc_time = \
+ commit_time = depth = 0
else:
create_dur = self.now.update_queue_duration / total
proc_dur = self.now.update_process_duration / total
que_dur = self.now.queue_time / total
init_proc_time = self.now.initial_process_time / total
commit_time = self.now.commit_time / total
- return (create_dur, proc_dur, que_dur, init_proc_time, commit_time)
+ depth = self.now.depth / total
+ return (create_dur, proc_dur, que_dur, init_proc_time,\
+ commit_time, depth)
def write_values(self, localtime_):
stats_headings = \
("Time", "Total Msgs",
- "Depth", "*Avg Que", "*Avg Create", "*Avg Proc",
+ "*Depth", "*Avg Que", "*Avg Create", "*Avg Proc",
"*Init Proc", "*Commit",
"*Enqueued", "*Dequeued", "*Dropped",
"*Create Agent", "*Update Agent", "*Delete Agent",
@@ -297,14 +302,20 @@
if not self.then:
return
try:
+ # get the original stats collected by --print-stats option
values = self._gather_values()
- values.insert(0, time.strftime("%H:%M:%S",localtime_))
- values.insert(1, self.now.enqueued)
- # include object update times
+ # get additional statistics
avg_create_dur,avg_process_dur,avg_que_dur, \
- avg_init_proc,avg_commit = self.get_update_durations()
+ avg_init_proc,avg_commit,avg_depth = self.get_update_durations()
+ # Replace element 0 with average Depth instead of
+ # instantaneous depth as given
+ values[0] = avg_depth
+
+ # Now augment the list with the rest of our expanded stats
+ values.insert(0, time.strftime("%H:%M:%S",localtime_))
+ values.insert(1, self.now.enqueued)
values.insert(3, avg_que_dur)
values.insert(4, avg_create_dur)
values.insert(5, avg_process_dur)
Modified: branches/scale_testing/wooly/python/wooly/datatable.py
===================================================================
--- branches/scale_testing/wooly/python/wooly/datatable.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/wooly/python/wooly/datatable.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -43,7 +43,7 @@
value = record[self.index]
if self.format is not None:
- value = self.format % value
+ value = value and self.format % value or None
return value
Modified: branches/scale_testing/wooly/python/wooly/wsgiserver/__init__.py
===================================================================
--- branches/scale_testing/wooly/python/wooly/wsgiserver/__init__.py 2011-01-04 21:25:50 UTC (rev 4448)
+++ branches/scale_testing/wooly/python/wooly/wsgiserver/__init__.py 2011-01-05 15:18:06 UTC (rev 4449)
@@ -91,6 +91,8 @@
import errno
+import cProfile
+
def plat_specific_errors(*errnames):
"""Return error numbers for all errors in errnames on this platform.
@@ -1354,23 +1356,38 @@
threading.Thread.__init__(self)
def run(self):
- try:
- self.ready = True
- while True:
- conn = self.server.requests.get()
- if conn is _SHUTDOWNREQUEST:
- return
+
+ def profWrapper():
+ try:
+ self.ready = True
+ while True:
+ conn = self.server.requests.get()
+ if conn is _SHUTDOWNREQUEST:
+ return
- self.conn = conn
- try:
- conn.communicate()
- finally:
- conn.close()
- self.conn = None
- except (KeyboardInterrupt, SystemExit), exc:
- self.server.interrupt = exc
+ self.conn = conn
+ try:
+ conn.communicate()
+ finally:
+ conn.close()
+ self.conn = None
+ except (KeyboardInterrupt, SystemExit), exc:
+ self.server.interrupt = exc
+ # put profile results in a subdirectory
+ ds = time.strftime("%m%d%y_%H%M%S",time.localtime())
+ p = os.path.join("./", \
+ "prof_"+ time.strftime("%m%d%y_%H%M%S",time.localtime()))
+ if not os.path.exists(p):
+ try:
+ os.makedirs(p)
+ except:
+ pass
+
+ p = os.path.join(p, self.getName())
+ cProfile.runctx('profWrapper()', globals(), locals(), p)
+
class ThreadPool(object):
"""A Request Queue for the CherryPyWSGIServer which pools threads.
13 years, 4 months
r4448 - trunk
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-01-04 21:25:50 +0000 (Tue, 04 Jan 2011)
New Revision: 4448
Modified:
trunk/README
Log:
Need a no op commit to change the revision number.
Modified: trunk/README
===================================================================
--- trunk/README 2011-01-04 19:39:32 UTC (rev 4447)
+++ trunk/README 2011-01-04 21:25:50 UTC (rev 4448)
@@ -89,6 +89,7 @@
Confirm new password: # Re-type said password
User 'guest' is added
+
USING THE DEVEL ENVIRONMENT
---------------------------
13 years, 4 months
r4447 - in trunk/cumin/python/cumin: . grid
by eallen@fedoraproject.org
Author: eallen
Date: 2011-01-04 19:39:32 +0000 (Tue, 04 Jan 2011)
New Revision: 4447
Modified:
trunk/cumin/python/cumin/grid/negotiator.py
trunk/cumin/python/cumin/model.py
Log:
Fix for BZ 637992: "Loading" message appears after 10 minutes if the quotas page is left open.
Also fixed parsing logic to handle the case when the negotiator GROUP_NAMES were separated by spaces and not commas.
Modified: trunk/cumin/python/cumin/grid/negotiator.py
===================================================================
--- trunk/cumin/python/cumin/grid/negotiator.py 2011-01-03 17:59:05 UTC (rev 4446)
+++ trunk/cumin/python/cumin/grid/negotiator.py 2011-01-04 19:39:32 UTC (rev 4447)
@@ -376,6 +376,8 @@
def split_group_names(self, group_string):
groups = []
g_string = group_string.replace(", ", ",")
+ if not "," in g_string:
+ return g_string.split()
return g_string.split(",")
def get_config_for_groups(self, session, config, groups):
Modified: trunk/cumin/python/cumin/model.py
===================================================================
--- trunk/cumin/python/cumin/model.py 2011-01-03 17:59:05 UTC (rev 4446)
+++ trunk/cumin/python/cumin/model.py 2011-01-04 19:39:32 UTC (rev 4447)
@@ -82,6 +82,7 @@
try:
try:
store = self.group_names_by_negotiator[negotiator._qmf_agent_id]
+ store.extend_updates()
except KeyError:
store = NegotiatorGroupNamesStore(self, negotiator)
store.start_updates()
@@ -101,6 +102,7 @@
try:
try:
store = self.group_config_values_by_negotiator[negotiator._qmf_agent_id]
+ store.extend_updates()
added = 0
for group in needed_groups:
added += store.add_group_config(group, config)
@@ -139,6 +141,7 @@
try:
try:
store = self.limits_by_negotiator[negotiator._qmf_agent_id]
+ store.extend_updates()
except KeyError:
store = NegotiatorLimitStore(self, negotiator)
store.start_updates()
@@ -159,6 +162,7 @@
try:
try:
store = self.job_summaries_by_submission[submission._id]
+ store.extend_updates()
except KeyError:
store = SubmissionJobSummaryStore(self, submission)
store.start_updates()
@@ -1037,6 +1041,9 @@
def start_updates(self):
self.update_thread.start()
+ def extend_updates(self):
+ self.update_thread.extend()
+
def update(self):
pass
@@ -1049,13 +1056,19 @@
self.store = store
self.setDaemon(True)
+ self.ticks = 0
+ def extend(self):
+ # if we get a request for this object's info
+ # keep polling for another 10 minutes
+ self.ticks = 0
+
def run(self):
conn = self.store.model.app.database.get_connection()
cursor = conn.cursor()
try:
- for i in range(20):
+ while self.ticks < 20:
try:
self.store.update(cursor)
self.store.exception = None
@@ -1063,6 +1076,7 @@
log.exception(e)
self.store.exception = e
+ self.ticks += 1
sleep(30)
finally:
conn.close()
13 years, 4 months