[rhmessaging-commits] rhmessaging commits: r1124 - mgmt/cumin/python/cumin.
rhmessaging-commits at lists.jboss.org
rhmessaging-commits at lists.jboss.org
Fri Oct 19 15:33:00 EDT 2007
Author: justi9
Date: 2007-10-19 15:33:00 -0400 (Fri, 19 Oct 2007)
New Revision: 1124
Modified:
mgmt/cumin/python/cumin/demo.py
mgmt/cumin/python/cumin/model.py
Log:
Adds a stat object to the demo model and makes the demo update thread
change the value.
Modified: mgmt/cumin/python/cumin/demo.py
===================================================================
--- mgmt/cumin/python/cumin/demo.py 2007-10-19 19:32:15 UTC (rev 1123)
+++ mgmt/cumin/python/cumin/demo.py 2007-10-19 19:33:00 UTC (rev 1124)
@@ -164,6 +164,10 @@
for queue in vhost.queue_items():
queue.lock()
try:
+ for stat in queue.stats:
+ if stat.type == "int" and random() < 0.33:
+ stat.value += 1
+
queue.message_count += 1
if random() < 0.01:
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-10-19 19:32:15 UTC (rev 1123)
+++ mgmt/cumin/python/cumin/model.py 2007-10-19 19:33:00 UTC (rev 1124)
@@ -268,6 +268,13 @@
writer.write("</realm>")
+class StatProperty(object):
+ def __init__(self, name, type):
+ self.name = name
+ self.type = type
+ self.title = None
+ self.value = None
+
class Queue(ModelObject):
def __init__(self, model):
super(Queue, self).__init__(model, model.queue)
@@ -283,6 +290,44 @@
self.error_count = 0
self.warning_count = 0
+ self.stats = list()
+
+ stat = StatProperty("msgTotalEnqueues", "int")
+ stat.title = "Total messages enqueued"
+ self.stats.append(stat)
+
+ stat = StatProperty("msgTotalDequeues", "int")
+ stat.title = "Total messages dequeued"
+ self.stats.append(stat)
+
+ stat = StatProperty("msgTxEnqueues", "int")
+ stat.title = "Transactional messages enqueued"
+ self.stats.append(stat)
+
+ stat = StatProperty("msgTxDequeues", "int")
+ stat.title = "Transactional messages dequeued"
+ self.stats.append(stat)
+
+ stat = StatProperty("msgPersistEnqueues", "int")
+ stat.title = "Persistent message enqueued"
+ self.stats.append(stat)
+
+ stat = StatProperty("msgPersistDequeues", "int")
+ stat.title = "Persistent messages dequeued"
+ self.stats.append(stat)
+
+ stat = StatProperty("msgDepth", "int")
+ stat.title = "Current number of messages in queue"
+ self.stats.append(stat)
+
+ stat = StatProperty("msgDepthHigh", "int")
+ stat.title = "Highest message depth in last x hours"
+ self.stats.append(stat)
+
+ stat = StatProperty("msgDepthLow", "int")
+ stat.title = "Lowest message depth in last x hours"
+ self.stats.append(stat)
+
def remove(self):
for binding in self.binding_items().copy():
binding.remove()
More information about the rhmessaging-commits
mailing list