[rhmessaging-commits] rhmessaging commits: r1203 - in mgmt: notes and 1 other directory.
rhmessaging-commits at lists.jboss.org
rhmessaging-commits at lists.jboss.org
Thu Nov 1 13:13:28 EDT 2007
Author: justi9
Date: 2007-11-01 13:13:28 -0400 (Thu, 01 Nov 2007)
New Revision: 1203
Modified:
mgmt/cumin/python/cumin/measurement.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/python/cumin/widgets.py
mgmt/notes/justin-todo.txt
Log:
First part of changes to the queue listing in the broker view.
Modified: mgmt/cumin/python/cumin/measurement.py
===================================================================
--- mgmt/cumin/python/cumin/measurement.py 2007-11-01 16:39:47 UTC (rev 1202)
+++ mgmt/cumin/python/cumin/measurement.py 2007-11-01 17:13:28 UTC (rev 1203)
@@ -38,7 +38,7 @@
% (measure.get_high() or 0, measure.get_low() or 0)
else:
unit = self.unit_abbrevs.get(measure.unit, measure.unit)
- return "%i <small>%s/sec</small>" % (measure.get_rate(), unit)
+ return rate(measure.get_rate(), unit, "sec")
def render_item_average(self, session, measure):
return "%0.2f" % (sum(measure.values) / float(len(measure.values)))
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-01 16:39:47 UTC (rev 1202)
+++ mgmt/cumin/python/cumin/model.py 2007-11-01 17:13:28 UTC (rev 1203)
@@ -366,7 +366,7 @@
else:
return self.__values[-limit:]
- def get_rate(self, interval=10):
+ def get_rate(self, interval=3):
values = self.get_values(2)
if len(values) > 1 and values[0] != None:
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-01 16:39:47 UTC (rev 1202)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-01 17:13:28 UTC (rev 1203)
@@ -52,12 +52,23 @@
def render_item_bindings(self, session, queue):
return len(queue.binding_items())
- def render_item_message_depth(self, session, queue):
+ def render_item_enqueues(self, session, queue):
+ value = queue.get_measurement("msgTotalEnqueues").get_rate()
+ return rate(value, "msg", "sec")
+
+ def render_item_dequeues(self, session, queue):
+ value = queue.get_measurement("msgTotalDequeues").get_rate()
+ return rate(value, "msg", "sec")
+
+ def render_item_depth(self, session, queue):
return queue.get_measurement("msgDepth").get_value()
- def render_item_byte_depth(self, session, queue):
- return queue.get_measurement("byteDepth").get_value()
+ def render_item_ratio(self, session, queue):
+ values = queue.get_measurement("msgDepth").get_values(2)
+ if len(values) > 1 and values[0] != None:
+ return "%0.00f" % (values[1] - values[0] / 3)
+
def render_item_status(self, session, queue):
return status(len(queue.errors), len(queue.warnings))
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-01 16:39:47 UTC (rev 1202)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-01 17:13:28 UTC (rev 1203)
@@ -18,8 +18,10 @@
<th>Name</th>
<th class="ralign">Consumers</th>
<th class="ralign">Exchange Bindings</th>
- <th class="ralign">Msg. Depth</th>
- <th class="ralign">Byte Depth</th>
+ <th class="ralign">Enqueues</th>
+ <th class="ralign">Dequeues</th>
+ <th class="ralign">Depth</th>
+ <th class="ralign">Ratio</th>
<th>Status</th>
</tr>
@@ -33,8 +35,10 @@
<td>{item_link}</a></td>
<td class="ralign">{item_consumers}</td>
<td class="ralign">{item_bindings}</td>
- <td class="ralign">{item_message_depth}</td>
- <td class="ralign">{item_byte_depth}</td>
+ <td class="ralign">{item_enqueues}</td>
+ <td class="ralign">{item_dequeues}</td>
+ <td class="ralign">{item_depth}</td>
+ <td class="ralign">{item_ratio}</td>
<td>{item_status}</td>
</tr>
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2007-11-01 16:39:47 UTC (rev 1202)
+++ mgmt/cumin/python/cumin/widgets.py 2007-11-01 17:13:28 UTC (rev 1203)
@@ -37,6 +37,9 @@
def yes_no(predicate):
return predicate and "Yes" or "No"
+def rate(value, unit1, unit2):
+ return "%i <small>%s/%s</small>" % (value, unit1, unit2)
+
class CuminFrame(Frame, ModeSet):
def __init__(self, app, name):
super(CuminFrame, self).__init__(app, name)
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-01 16:39:47 UTC (rev 1202)
+++ mgmt/notes/justin-todo.txt 2007-11-01 17:13:28 UTC (rev 1203)
@@ -26,6 +26,8 @@
* Restyle drop boxes to not be beveled
+ * Right align status boxes?
+
Deferred
* Make the status lights also be links to an appropriate view
More information about the rhmessaging-commits
mailing list