Author: justi9
Date: 2007-11-06 13:23:41 -0500 (Tue, 06 Nov 2007)
New Revision: 1250
Modified:
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/client.strings
mgmt/cumin/python/cumin/model.py
Log:
Reorders stat elements of queue and exchange to be more uniform.
Adds a status light to client and moves attachment to its own column.
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-11-06 18:14:40 UTC (rev 1249)
+++ mgmt/cumin/python/cumin/client.py 2007-11-06 18:23:41 UTC (rev 1250)
@@ -135,13 +135,16 @@
def render_item_name(self, session, session_):
return session_.name
- def render_item_status(self, session, session_):
- result = session_.get_measurement("attached").get_value()
- return result and "Attached" or "Detached"
-
def render_item_remaining_lifespan(self, session, session_):
value = session_.get_measurement("remainingLifespan").get_value()
return fmt_duration(value)
def render_item_frames_outstanding(self, session, session_):
return session_.get_measurement("framesOutstanding").get_value()
+
+ def render_item_attached(self, session, session_):
+ result = session_.get_measurement("attached").get_value()
+ return fmt_predicate(result)
+
+ def render_item_status(self, session, session_):
+ return fmt_status(len(session_.errors), len(session_.warnings))
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-11-06 18:14:40 UTC (rev 1249)
+++ mgmt/cumin/python/cumin/client.strings 2007-11-06 18:23:41 UTC (rev 1250)
@@ -84,6 +84,7 @@
<th>Name</th>
<th class="ralign">Remaining Lifespan</th>
<th class="ralign">Frames Outstanding</th>
+ <th>Attached?</th>
<th>Status</th>
</tr>
@@ -96,5 +97,6 @@
<td>{item_name}</td>
<td class="ralign">{item_remaining_lifespan}</td>
<td class="ralign">{item_frames_outstanding}</td>
+ <td>{item_attached}</td>
<td>{item_status}</td>
</tr>
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-06 18:14:40 UTC (rev 1249)
+++ mgmt/cumin/python/cumin/model.py 2007-11-06 18:23:41 UTC (rev 1250)
@@ -398,6 +398,20 @@
# General
+ measure = Measurement("consumers", "int")
+ measure.title = "Consumers"
+ measure.unit = "consumer"
+ measure.categories = ("general")
+ measure.highlow = True
+ self.measurements.append(measure)
+
+ measure = Measurement("bindings", "int")
+ measure.title = "Bindings"
+ measure.unit = "binding"
+ measure.categories = ("general")
+ measure.highlow = True
+ self.measurements.append(measure)
+
measure = Measurement("msgDepth", "int")
measure.title = "Message Depth"
measure.unit = "message"
@@ -442,20 +456,6 @@
measure.categories = ("general")
self.measurements.append(measure)
- measure = Measurement("consumers", "int")
- measure.title = "Consumers"
- measure.unit = "consumer"
- measure.categories = ("general")
- measure.highlow = True
- self.measurements.append(measure)
-
- measure = Measurement("bindings", "int")
- measure.title = "Bindings"
- measure.unit = "binding"
- measure.categories = ("general")
- measure.highlow = True
- self.measurements.append(measure)
-
# Disk
#measure = Measurement("diskPageSize", "int")
@@ -641,6 +641,20 @@
self.errors = list()
self.warnings = list()
+ measure = Measurement("producers", "int")
+ measure.title = "Producers"
+ measure.unit = "producer"
+ measure.categories = ("general")
+ measure.highlow = True
+ self.measurements.append(measure)
+
+ measure = Measurement("bindings", "int")
+ measure.title = "Bindings"
+ measure.unit = "binding"
+ measure.categories = ("general")
+ measure.highlow = True
+ self.measurements.append(measure)
+
measure = Measurement("msgReceives", "int")
measure.title = "Msgs. Received"
measure.unit = "message"
@@ -677,20 +691,6 @@
measure.categories = ("byte", "general")
self.measurements.append(measure)
- measure = Measurement("producers", "int")
- measure.title = "Producers"
- measure.unit = "producer"
- measure.categories = ("general")
- measure.highlow = True
- self.measurements.append(measure)
-
- measure = Measurement("bindings", "int")
- measure.title = "Bindings"
- measure.unit = "binding"
- measure.categories = ("general")
- measure.highlow = True
- self.measurements.append(measure)
-
def remove(self):
for binding in self.binding_items().copy():
binding.remove()
@@ -780,6 +780,9 @@
self.name = None
+ self.errors = list()
+ self.warnings = list()
+
measure = Measurement("attached", "bool")
measure.title = "Attached"
measure.categories = ("general")