Author: justi9
Date: 2007-10-22 10:28:31 -0400 (Mon, 22 Oct 2007)
New Revision: 1130
Modified:
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
Log:
Adds a missing intrumentation prop to queue. Fixes rendering of null
values in templates. Adds high and low values to Measurement.
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-10-22 14:00:08 UTC (rev 1129)
+++ mgmt/cumin/python/cumin/model.py 2007-10-22 14:28:31 UTC (rev 1130)
@@ -277,6 +277,10 @@
self.__value = None
self.values = list()
+ self.highlow = False
+ self.__high = None
+ self.__low = None
+
if type == "int":
self.add_value(0)
@@ -287,9 +291,26 @@
if len(self.values) > 1000:
del self.values[0]
+ if self.highlow:
+ if self.__high == None or self.__low == None:
+ self.__high = value
+ self.__low = value
+ else:
+ if self.__high < value:
+ self.__high = value
+
+ if self.__low > value:
+ self.__low = value
+
def get_value(self):
return self.__value
+ def get_high(self):
+ return self.__high
+
+ def get_low(self):
+ return self.__low
+
class Queue(ModelObject):
def __init__(self, model):
super(Queue, self).__init__(model, model.queue)
@@ -312,6 +333,7 @@
measure = Measurement("msgDepth", "int")
measure.title = "Message depth"
measure.categories = ("message", "general")
+ measure.highlow = True
self.measurements.append(measure)
measure = Measurement("msgTotalEnqueues", "int")
@@ -327,6 +349,7 @@
measure = Measurement("byteDepth", "int")
measure.title = "Byte depth"
measure.categories = ("byte", "general")
+ measure.highlow = True
self.measurements.append(measure)
measure = Measurement("byteTotalEnqueues", "int")
@@ -339,6 +362,12 @@
measure.categories = ("byte", "general")
self.measurements.append(measure)
+ measure = Measurement("consumers", "int")
+ measure.title = "Consumers"
+ measure.categories = ("general")
+ measure.highlow = True
+ self.measurements.append(measure)
+
# Disk
measure = Measurement("diskPageSize", "int")
@@ -396,6 +425,7 @@
measure = Measurement("enqueueTxCount", "int")
measure.title = "Enq. trans. pending"
measure.categories = ("transactional")
+ measure.highlow = True
self.measurements.append(measure)
measure = Measurement("dequeueTxStarts", "int")
@@ -416,6 +446,7 @@
measure = Measurement("dequeueTxCount", "int")
measure.title = "Deq. trans. pending"
measure.categories = ("transactional")
+ measure.highlow = True
self.measurements.append(measure)
# Persistent
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-10-22 14:00:08 UTC (rev 1129)
+++ mgmt/cumin/python/cumin/queue.py 2007-10-22 14:28:31 UTC (rev 1130)
@@ -361,6 +361,15 @@
def render_item_value(self, session, measure):
return measure.get_value()
+ def render_item_high(self, session, measure):
+ return measure.get_high()
+
+ def render_item_low(self, session, measure):
+ if measure.highlow:
+ print type(measure.get_low())
+
+ return measure.get_low()
+
def render_item_average_value(self, session, measure):
return "%0.2f" % (sum(measure.values) / float(len(measure.values)))
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-10-22 14:00:08 UTC (rev 1129)
+++ mgmt/cumin/python/cumin/queue.strings 2007-10-22 14:28:31 UTC (rev 1130)
@@ -191,7 +191,8 @@
<tr>
<th>Statistic</th>
<th>Current</th>
- <th>Average</th>
+ <th>High</th>
+ <th>Low</th>
</tr>
{items}
@@ -201,5 +202,6 @@
<tr>
<th>{item_title}</th>
<td>{item_value}</td>
- <td>{item_average_value}</td>
+ <td>{item_high}</td>
+ <td>{item_low}</td>
</tr>
\ No newline at end of file
Show replies by date