Author: justi9
Date: 2007-10-23 11:01:37 -0400 (Tue, 23 Oct 2007)
New Revision: 1143
Modified:
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/exchange.strings
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/python/cumin/util.py
mgmt/notes/Todo
Log:
Adds more stats to aggreg views of queues and exchanges. Sketches in
actions.
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-10-23 14:19:24 UTC (rev 1142)
+++ mgmt/cumin/python/cumin/exchange.py 2007-10-23 15:01:37 UTC (rev 1143)
@@ -51,6 +51,18 @@
def render_item_status(self, session, exchange):
return "2 errors"
+ def render_item_messages_received(self, session, exchange):
+ return exchange.get_measurement("msgReceives").get_value()
+
+ def render_item_bytes_received(self, session, exchange):
+ return exchange.get_measurement("byteReceives").get_value()
+
+ def render_item_messages_routed(self, session, exchange):
+ return exchange.get_measurement("msgRoutes").get_value()
+
+ def render_item_bytes_routed(self, session, exchange):
+ return exchange.get_measurement("byteRoutes").get_value()
+
class ExchangeFrame(CuminFrame):
def __init__(self, app, name):
super(ExchangeFrame, self).__init__(app, name)
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2007-10-23 14:19:24 UTC (rev 1142)
+++ mgmt/cumin/python/cumin/exchange.strings 2007-10-23 15:01:37 UTC (rev 1143)
@@ -17,6 +17,10 @@
<th>Exchange</th>
<th>Configuration</th>
<th>Status</th>
+ <th style="text-align: right;">Msgs. Received</th>
+ <th style="text-align: right;">Bytes Received</th>
+ <th style="text-align: right;">Msgs. Routed</th>
+ <th style="text-align: right;">Bytes Routed</th>
</tr>
{items}
@@ -27,6 +31,10 @@
<td>{item_link}</a></td>
<td>{item_config}</td>
<td>{item_status}</td>
+ <td style="text-align: right;">{item_messages_received}</td>
+ <td style="text-align: right;">{item_bytes_received}</td>
+ <td style="text-align: right;">{item_messages_routed}</td>
+ <td style="text-align: right;">{item_bytes_routed}</td>
</tr>
[ExchangeForm.html]
@@ -95,7 +103,7 @@
<table class="ExchangeBindingSet mobjects">
<tr>
<th>Queue</th>
- <th>Routing Key</th>
+ <th>Key</th>
<th style="text-align: right;">Messages Matched</th>
</tr>
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-10-23 14:19:24 UTC (rev 1142)
+++ mgmt/cumin/python/cumin/queue.py 2007-10-23 15:01:37 UTC (rev 1143)
@@ -47,12 +47,22 @@
def render_item_config(self, session, queue):
count = len(queue.binding_items())
- return "%i %s" % (count, count == 1 and "binding" or
"bindings")
+ return "%i binding%s" % (count, ess(count))
def render_item_status(self, session, queue):
- return "%i messages in queue<br/>%i errors, %i warnings" \
- % (queue.message_count, queue.error_count, queue.warning_count)
+ return "%i error%s, %i warning%s" \
+ % (queue.error_count, ess(queue.error_count),
+ queue.warning_count, ess(queue.warning_count))
+ def render_item_message_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_consumers(self, session, queue):
+ return queue.get_measurement("consumers").get_value()
+
class QueueFrame(CuminFrame):
def __init__(self, app, name):
super(QueueFrame, self).__init__(app, name)
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-10-23 14:19:24 UTC (rev 1142)
+++ mgmt/cumin/python/cumin/queue.strings 2007-10-23 15:01:37 UTC (rev 1143)
@@ -6,21 +6,38 @@
}
[QueueSet.html]
-<table class="QueueSet mobjects">
- <tr>
- <th>Queue</th>
- <th>Configuration</th>
- <th>Status</th>
- </tr>
+<form>
+ <select>
+ <option>Act on Selection...</option>
+ <option>Purge Messages</option>
+ </select>
- {items}
-</table>
+ <br/><br/>
+ <table class="QueueSet mobjects">
+ <tr>
+ <th><input type="checkbox"/></th>
+ <th>Queue</th>
+ <th>Configuration</th>
+ <th>Status</th>
+ <th style="text-align: right;">Msg. Depth</th>
+ <th style="text-align: right;">Byte Depth</th>
+ <th style="text-align: right;">Consumers</th>
+ </tr>
+
+ {items}
+ </table>
+</form>
+
[QueueSet.item_html]
<tr>
+ <td><input type="checkbox"/></td>
<td>{item_link}</a></td>
<td>{item_config}</td>
<td>{item_status}</td>
+ <td style="text-align: right;">{item_message_depth}</td>
+ <td style="text-align: right;">{item_byte_depth}</td>
+ <td style="text-align: right;">{item_consumers}</td>
</tr>
[QueueForm.html]
@@ -121,7 +138,7 @@
<table class="QueueBindingSet mobjects">
<tr>
<th>Exchange</th>
- <th>Routing Key</th>
+ <th>Key</th>
<th style="text-align: right;">Messages Matched</th>
</tr>
Modified: mgmt/cumin/python/cumin/util.py
===================================================================
--- mgmt/cumin/python/cumin/util.py 2007-10-23 14:19:24 UTC (rev 1142)
+++ mgmt/cumin/python/cumin/util.py 2007-10-23 15:01:37 UTC (rev 1143)
@@ -1,2 +1,5 @@
def sorted_by(seq, attr="name"):
return sorted(seq, cmp, lambda x: getattr(x, attr))
+
+def ess(num, ending="s"):
+ return num != 1 and ending or ""
Modified: mgmt/notes/Todo
===================================================================
--- mgmt/notes/Todo 2007-10-23 14:19:24 UTC (rev 1142)
+++ mgmt/notes/Todo 2007-10-23 15:01:37 UTC (rev 1143)
@@ -108,3 +108,5 @@
* Add a sanity check traversal to the widget tree and to the
registered sets of widgets and parameters
+
+ * Rename routing_key to binding_key