Author: justi9
Date: 2007-11-27 18:19:28 -0500 (Tue, 27 Nov 2007)
New Revision: 1378
Modified:
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.py
Log:
Update the stat metadata for the renamed statsCurr.
Make more places use the stat metadata instead of directly accessing
it.
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-27 22:49:31 UTC (rev 1377)
+++ mgmt/cumin/python/cumin/model.py 2007-11-27 23:19:28 UTC (rev 1378)
@@ -63,7 +63,7 @@
self.cumin_class.add_stat(self)
def value(self, object):
- return nvl(getattr(object.stats, self.name), -1)
+ return nvl(getattr(object.statsCurr, self.name, -1), -1)
def samples(self, object, limit=None):
name = self.cumin_class.name
@@ -82,8 +82,8 @@
return samples
def rate(self, object):
- if object.stats:
- curr = getattr(object.stats, self.name)
+ if object.statsCurr:
+ curr = getattr(object.statsCurr, self.name)
if object.statsPrev:
prev = getattr(object.statsPrev, self.name)
@@ -93,9 +93,9 @@
else:
return -1
else:
- return -1
+ return -2
else:
- return -1
+ return -3
def write_xml(self, object, writer):
writer.write("<stat name=\"%s\" value=\"%i\"
rate=\"%i\"/>" \
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-27 22:49:31 UTC (rev 1377)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-27 23:19:28 UTC (rev 1378)
@@ -117,7 +117,7 @@
class QueueStatus(CuminStatus):
def render_consumers(self, session, queue):
- return queue.stats.consumers
+ return self.app.cmodel.queue.get_stat("consumers").value(queue)
def render_messages_enqueued(self, session, queue):
stat = self.app.cmodel.queue.get_stat("msgTotalEnqueues")
@@ -128,7 +128,7 @@
return fmt_rate(stat.rate(queue), "msg", "sec")
def render_message_depth(self, session, queue):
- return queue.stats.msgDepth
+ return self.app.cmodel.queue.get_stat("msgDepth").value(queue)
def render_message_depth_accel(self, session, queue):
stat = self.app.cmodel.queue.get_stat("msgDepth")
@@ -143,7 +143,7 @@
return fmt_rate(stat.rate(queue), "byte", "sec")
def render_byte_depth(self, session, queue):
- return queue.stats.byteDepth
+ return self.app.cmodel.queue.get_stat("byteDepth").value(queue)
def render_byte_depth_accel(self, session, queue):
stat = self.app.cmodel.queue.get_stat("byteDepth")
Show replies by date