rhmessaging commits: r1216 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-02 12:22:00 -0400 (Fri, 02 Nov 2007)
New Revision: 1216
Modified:
mgmt/cumin/python/cumin/page.strings
Log:
Adjusts some spacing.
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-11-02 16:12:10 UTC (rev 1215)
+++ mgmt/cumin/python/cumin/page.strings 2007-11-02 16:22:00 UTC (rev 1216)
@@ -374,7 +374,7 @@
ul.radiotabs li {
display: inline;
- margin: 0 1em 0 0;
+ margin: 0 0.75em 0 0;
}
ul.radiotabs li a:before {
17 years, 1 month
rhmessaging commits: r1215 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-02 12:12:10 -0400 (Fri, 02 Nov 2007)
New Revision: 1215
Modified:
mgmt/cumin/python/cumin/page.strings
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/python/cumin/widgets.py
Log:
Adds a reusable CuminStatus widget and uses it for queue status.
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-11-02 15:46:24 UTC (rev 1214)
+++ mgmt/cumin/python/cumin/page.strings 2007-11-02 16:12:10 UTC (rev 1215)
@@ -400,6 +400,9 @@
div.mstatus h2 {
font-weight: bold;
+}
+
+div.mstatus div, div.mstatus h2 {
margin: 0 0 0.5em 0;
}
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-02 15:46:24 UTC (rev 1214)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-02 16:12:10 UTC (rev 1215)
@@ -113,15 +113,7 @@
def render_title(self, session, queue):
return "Queue '%s'" % queue.name
-class QueueStatus(Widget):
- def render_class(self, session, queue):
- if queue.errors:
- return "QueueStatus red"
- elif queue.warnings:
- return "QueueStatus yellow"
- else:
- return "QueueStatus green"
-
+class QueueStatus(CuminStatus):
def render_url(self, session, queue):
return "queue.xml?id=%i" % queue.id
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-02 15:46:24 UTC (rev 1214)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-02 16:12:10 UTC (rev 1215)
@@ -120,9 +120,11 @@
//wooly.setIntervalUpdate("{id}", "{url}", updateStatus, 3000);
}())
</script>
-<div class="{class} mstatus" id="{id}">
+<div id="{id}" class="{class}">
<h2>Queue Status</h2>
+ <div>{status_info}</div>
+
<table>
<tr>
<th></th>
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2007-11-02 15:46:24 UTC (rev 1214)
+++ mgmt/cumin/python/cumin/widgets.py 2007-11-02 16:12:10 UTC (rev 1215)
@@ -2,6 +2,8 @@
from wooly.widgets import *
from wooly.forms import *
+from util import *
+
strings = StringCatalog(__file__)
def link(href, content, class_=""):
@@ -136,3 +138,19 @@
class CuminConfirmForm(CuminForm):
def __init__(self, app, name):
super(CuminConfirmForm, self).__init__(app, name)
+
+class CuminStatus(Widget):
+ def render_class(self, session, object):
+ if object.errors:
+ return "mstatus red"
+ elif object.warnings:
+ return "mstatus yellow"
+ else:
+ return "mstatus green"
+
+ def render_status_info(self, session, object):
+ error_count = len(object.errors)
+ warning_count = len(object.warnings)
+
+ return "%i error%s, %i warning%s" % (error_count, ess(error_count),
+ warning_count, ess(warning_count))
17 years, 1 month
rhmessaging commits: r1214 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-02 11:46:24 -0400 (Fri, 02 Nov 2007)
New Revision: 1214
Modified:
mgmt/cumin/python/cumin/measurement.py
mgmt/cumin/python/cumin/page.strings
mgmt/cumin/python/cumin/widgets.py
Log:
Makes rate display briefer.
Modified: mgmt/cumin/python/cumin/measurement.py
===================================================================
--- mgmt/cumin/python/cumin/measurement.py 2007-11-02 15:36:42 UTC (rev 1213)
+++ mgmt/cumin/python/cumin/measurement.py 2007-11-02 15:46:24 UTC (rev 1214)
@@ -34,7 +34,7 @@
def render_item_extra(self, session, measure):
if measure.highlow:
- return "<small>high</small> %i <small>low</small> %i" \
+ return "<small>high</small> %i <small>low</small> %i" \
% (measure.get_high() or 0, measure.get_low() or 0)
else:
unit = self.unit_abbrevs.get(measure.unit, measure.unit)
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-11-02 15:36:42 UTC (rev 1213)
+++ mgmt/cumin/python/cumin/page.strings 2007-11-02 15:46:24 UTC (rev 1214)
@@ -395,7 +395,7 @@
float: right;
margin: 0.5em;
padding: 0.75em 1em;
- width: 18em;
+ width: 15em;
}
div.mstatus h2 {
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2007-11-02 15:36:42 UTC (rev 1213)
+++ mgmt/cumin/python/cumin/widgets.py 2007-11-02 15:46:24 UTC (rev 1214)
@@ -38,7 +38,8 @@
return predicate and "Yes" or "No"
def rate(value, unit1, unit2):
- return "%i <small>%s/%s</small>" % (value, unit1, unit2)
+ #return "%i <small>%s/%s</small>" % (value, unit1, unit2)
+ return "%i<small>/%s</small>" % (value, unit2)
class CuminFrame(Frame, ModeSet):
def __init__(self, app, name):
17 years, 1 month
rhmessaging commits: r1213 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-02 11:36:42 -0400 (Fri, 02 Nov 2007)
New Revision: 1213
Modified:
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.py
Log:
Simplifies rate calculation.
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-02 15:05:32 UTC (rev 1212)
+++ mgmt/cumin/python/cumin/model.py 2007-11-02 15:36:42 UTC (rev 1213)
@@ -356,7 +356,6 @@
values.reverse()
# Pad the values if there are too few
-
if len(values) < limit:
for i in range(len(values), limit):
values.append(0)
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-02 15:05:32 UTC (rev 1212)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-02 15:36:42 UTC (rev 1213)
@@ -90,9 +90,10 @@
return queue.get_measurement(key).get_value()
def render_item_depth_accel(self, session, queue):
- key = self.unit.get(session) == "b" and "byteDepth" or "msgDepth"
- curr, prev = queue.get_measurement(key).get_values(2)
- return "%0.00f" % ((curr - prev) / float(1))
+ unit = self.unit.get(session)
+ key = unit == "b" and "byteDepth" or "msgDepth"
+ value = queue.get_measurement(key).get_rate()
+ return rate(value, unit == "b" and "byte" or "msg", "sec")
def render_item_status(self, session, queue):
return status(len(queue.errors), len(queue.warnings))
@@ -139,8 +140,8 @@
return queue.get_measurement("msgDepth").get_value()
def render_message_depth_accel(self, session, queue):
- curr, prev = queue.get_measurement("msgDepth").get_values(2)
- return "%.00f" % ((curr - prev) / float(1))
+ value = queue.get_measurement("msgDepth").get_rate()
+ return rate(value, "msg", "sec")
def render_byte_enqueues(self, session, queue):
value = queue.get_measurement("byteTotalEnqueues").get_rate()
@@ -154,8 +155,8 @@
return queue.get_measurement("byteDepth").get_value()
def render_byte_depth_accel(self, session, queue):
- curr, prev = queue.get_measurement("byteDepth").get_values(2)
- return "%.00f" % ((curr - prev) / float(1))
+ value = queue.get_measurement("byteDepth").get_rate()
+ return rate(value, "byte", "sec")
# def render_error_info(self, session, queue):
# return "%i %s, %i %s" % \
17 years, 1 month
rhmessaging commits: r1212 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-02 11:05:32 -0400 (Fri, 02 Nov 2007)
New Revision: 1212
Modified:
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
Log:
Fixes depth acceleration calculations. Labels them as "Accel.".
Makes Measurement.get_values pad its returned set if it's too small.
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-02 14:37:54 UTC (rev 1211)
+++ mgmt/cumin/python/cumin/model.py 2007-11-02 15:05:32 UTC (rev 1212)
@@ -350,27 +350,23 @@
def get_value(self):
return self.__value
- # get recent values, with latest value at index 0
+ # Get recent values, with latest value at index 0
def get_values(self, limit=100):
- if len(self.__values) == 0:
- values = [0, 0]
- else:
- values = self.__values[-limit:]
- values.reverse()
+ values = self.__values[-limit:]
+ values.reverse()
- if len(values) == 1:
+ # Pad the values if there are too few
+
+ if len(values) < limit:
+ for i in range(len(values), limit):
values.append(0)
return values
- def get_rate(self, interval=3):
- values = self.get_values(2)
+ def get_rate(self, interval=1):
+ curr, prev = self.get_values(2)
+ return (curr - prev) / float(interval)
- if len(values) > 1 and values[0] != None:
- return (values[0] - values[1]) / interval
- else:
- return 0
-
def get_high(self):
return self.__high
@@ -393,54 +389,52 @@
# General
- MgmtQueueStats = None
-
- measure = Measurement("msgDepth", "int", MgmtQueueStats)
+ measure = Measurement("msgDepth", "int")
measure.title = "Message Depth"
measure.unit = "message"
measure.categories = ("message", "general")
measure.highlow = True
self.measurements.append(measure)
- measure = Measurement("msgTotalEnqueues", "int", MgmtQueueStats)
+ measure = Measurement("msgTotalEnqueues", "int")
measure.title = "Msgs. Enqueued"
measure.unit = "message"
measure.categories = ("message", "general")
self.measurements.append(measure)
- measure = Measurement("msgTotalDequeues", "int", MgmtQueueStats)
+ measure = Measurement("msgTotalDequeues", "int")
measure.title = "Msgs. Dequeued"
measure.unit = "message"
measure.categories = ("message", "general")
self.measurements.append(measure)
- measure = Measurement("byteDepth", "int", MgmtQueueStats)
+ measure = Measurement("byteDepth", "int")
measure.title = "Byte Depth"
measure.unit = "byte"
measure.categories = ("byte", "general")
measure.highlow = True
self.measurements.append(measure)
- measure = Measurement("byteTotalEnqueues", "int", MgmtQueueStats)
+ measure = Measurement("byteTotalEnqueues", "int")
measure.title = "Bytes Enqueued"
measure.unit = "byte"
measure.categories = ("byte", "general")
self.measurements.append(measure)
- measure = Measurement("byteTotalDequeues", "int", MgmtQueueStats)
+ measure = Measurement("byteTotalDequeues", "int")
measure.title = "Bytes Dequeued"
measure.unit = "byte"
measure.categories = ("byte", "general")
self.measurements.append(measure)
- measure = Measurement("consumers", "int", MgmtQueueStats)
+ measure = Measurement("consumers", "int")
measure.title = "Consumers"
measure.unit = "consumer"
measure.categories = ("general")
measure.highlow = True
self.measurements.append(measure)
- measure = Measurement("unackedMessages", "int", MgmtQueueStats)
+ measure = Measurement("unackedMessages", "int")
measure.title = "Msgs. Unacked"
measure.unit = "message"
measure.categories = ("general")
@@ -453,7 +447,7 @@
#measure.categories = ("disk")
#self.measurements.append(measure)
- measure = Measurement("diskPages", "int", MgmtQueueStats)
+ measure = Measurement("diskPages", "int")
measure.title = "Disk Pages"
measure.unit = "page"
measure.categories = ("general")
@@ -466,74 +460,74 @@
# Transactional
- measure = Measurement("msgTxEnqueues", "int", MgmtQueueStats)
+ measure = Measurement("msgTxEnqueues", "int")
measure.title = "Msgs. Enqueued"
measure.unit = "message"
measure.categories = ("message", "transactional")
self.measurements.append(measure)
- measure = Measurement("msgTxDequeues", "int", MgmtQueueStats)
+ measure = Measurement("msgTxDequeues", "int")
measure.title = "Msgs. Dequeued"
measure.unit = "message"
measure.categories = ("message", "transactional")
self.measurements.append(measure)
- measure = Measurement("byteTxEnqueues", "int", MgmtQueueStats)
+ measure = Measurement("byteTxEnqueues", "int")
measure.title = "Bytes Enqueued"
measure.unit = "byte"
measure.categories = ("byte", "transactional")
self.measurements.append(measure)
- measure = Measurement("byteTxDequeues", "int", MgmtQueueStats)
+ measure = Measurement("byteTxDequeues", "int")
measure.title = "Bytes Dequeued"
measure.unit = "byte"
measure.categories = ("byte", "transactional")
self.measurements.append(measure)
- measure = Measurement("enqueueTxStarts", "int", MgmtQueueStats)
+ measure = Measurement("enqueueTxStarts", "int")
measure.title = "Enq. Trans. Started"
measure.unit = "transaction"
measure.categories = ("transaction")
self.measurements.append(measure)
- measure = Measurement("enqueueTxCommits", "int", MgmtQueueStats)
+ measure = Measurement("enqueueTxCommits", "int")
measure.title = "Enq. Trans. Committed"
measure.unit = "transaction"
measure.categories = ("transaction")
self.measurements.append(measure)
- measure = Measurement("enqueueTxRejects", "int", MgmtQueueStats)
+ measure = Measurement("enqueueTxRejects", "int")
measure.title = "Enq. Trans. Rejected"
measure.unit = "transaction"
measure.categories = ("transaction")
self.measurements.append(measure)
- measure = Measurement("enqueueTxCount", "int", MgmtQueueStats)
+ measure = Measurement("enqueueTxCount", "int")
measure.title = "Enq. Trans. Pending"
measure.unit = "transaction"
measure.categories = ("transaction")
measure.highlow = True
self.measurements.append(measure)
- measure = Measurement("dequeueTxStarts", "int", MgmtQueueStats)
+ measure = Measurement("dequeueTxStarts", "int")
measure.title = "Deq. Trans. Started"
measure.unit = "transaction"
measure.categories = ("transaction")
self.measurements.append(measure)
- measure = Measurement("dequeueTxCommits", "int", MgmtQueueStats)
+ measure = Measurement("dequeueTxCommits", "int")
measure.title = "Deq. Trans. Committed"
measure.unit = "transaction"
measure.categories = ("transaction")
self.measurements.append(measure)
- measure = Measurement("dequeueTxRejects", "int", MgmtQueueStats)
+ measure = Measurement("dequeueTxRejects", "int")
measure.title = "Deq. Trans. Rejected"
measure.unit = "transaction"
measure.categories = ("transaction")
self.measurements.append(measure)
- measure = Measurement("dequeueTxCount", "int", MgmtQueueStats)
+ measure = Measurement("dequeueTxCount", "int")
measure.title = "Deq. Trans. Pending"
measure.unit = "transaction"
measure.categories = ("transaction")
@@ -542,25 +536,25 @@
# Persistent
- measure = Measurement("msgPersistEnqueues", "int", MgmtQueueStats)
+ measure = Measurement("msgPersistEnqueues", "int")
measure.title = "Msgs. Enqueued"
measure.unit = "message"
measure.categories = ("message", "persistent")
self.measurements.append(measure)
- measure = Measurement("msgPersistDequeues", "int", MgmtQueueStats)
+ measure = Measurement("msgPersistDequeues", "int")
measure.title = "Msgs. Dequeued"
measure.unit = "message"
measure.categories = ("message", "persistent")
self.measurements.append(measure)
- measure = Measurement("bytePersistEnqueues", "int", MgmtQueueStats)
+ measure = Measurement("bytePersistEnqueues", "int")
measure.title = "Bytes Enqueued"
measure.unit = "byte"
measure.categories = ("byte", "persistent")
self.measurements.append(measure)
- measure = Measurement("bytePersistDequeues", "int", MgmtQueueStats)
+ measure = Measurement("bytePersistDequeues", "int")
measure.title = "Bytes Dequeued"
measure.unit = "byte"
measure.categories = ("byte", "persistent")
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-02 14:37:54 UTC (rev 1211)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-02 15:05:32 UTC (rev 1212)
@@ -89,13 +89,11 @@
key = self.unit.get(session) == "b" and "byteDepth" or "msgDepth"
return queue.get_measurement(key).get_value()
- def render_item_ratio(self, session, queue):
+ def render_item_depth_accel(self, session, queue):
key = self.unit.get(session) == "b" and "byteDepth" or "msgDepth"
- values = queue.get_measurement(key).get_values(2)
+ curr, prev = queue.get_measurement(key).get_values(2)
+ return "%0.00f" % ((curr - prev) / float(1))
- if len(values) > 1 and values[0] != None:
- return "%0.00f" % (values[0] - values[1] / 3)
-
def render_item_status(self, session, queue):
return status(len(queue.errors), len(queue.warnings))
@@ -140,12 +138,10 @@
def render_message_depth(self, session, queue):
return queue.get_measurement("msgDepth").get_value()
- def render_message_depth_ratio(self, session, queue):
+ def render_message_depth_accel(self, session, queue):
curr, prev = queue.get_measurement("msgDepth").get_values(2)
+ return "%.00f" % ((curr - prev) / float(1))
- if prev != 0:
- return "%0.00f" % (curr / float(prev))
-
def render_byte_enqueues(self, session, queue):
value = queue.get_measurement("byteTotalEnqueues").get_rate()
return rate(value, "byte", "sec")
@@ -157,12 +153,10 @@
def render_byte_depth(self, session, queue):
return queue.get_measurement("byteDepth").get_value()
- def render_byte_depth_ratio(self, session, queue):
+ def render_byte_depth_accel(self, session, queue):
curr, prev = queue.get_measurement("byteDepth").get_values(2)
+ return "%.00f" % ((curr - prev) / float(1))
- if prev != 0:
- return "%0.00f" % (curr / float(prev))
-
# def render_error_info(self, session, queue):
# return "%i %s, %i %s" % \
# (queue.error_count,
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-02 14:37:54 UTC (rev 1211)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-02 15:05:32 UTC (rev 1212)
@@ -26,7 +26,7 @@
<th class="ralign">Enqueues</th>
<th class="ralign">Dequeues</th>
<th class="ralign">Depth</th>
- <th class="ralign">Ratio</th>
+ <th class="ralign">Accel.</th>
<th>Status</th>
</tr>
@@ -43,7 +43,7 @@
<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 class="ralign">{item_depth_accel}</td>
<td>{item_status}</td>
</tr>
@@ -123,12 +123,6 @@
<div class="{class} mstatus" id="{id}">
<h2>Queue Status</h2>
-<!--
- <div>{message_info}</div>
- <div>{error_info}</div>
- <div>{consumers}</div>
--->
-
<table>
<tr>
<th></th>
@@ -151,9 +145,9 @@
<td class="ralign">{byte_depth}</td>
</tr>
<tr>
- <th>Ratio</th>
- <td class="ralign">{message_depth_ratio}</td>
- <td class="ralign">{byte_depth_ratio}</td>
+ <th>Accel.</th>
+ <td class="ralign">{message_depth_accel}</td>
+ <td class="ralign">{byte_depth_accel}</td>
</tr>
</table>
</div>
17 years, 1 month
rhmessaging commits: r1211 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-02 10:37:54 -0400 (Fri, 02 Nov 2007)
New Revision: 1211
Modified:
mgmt/cumin/python/cumin/demo.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/page.strings
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/python/cumin/util.py
mgmt/notes/justin-todo.txt
Log:
Makes queue status contain the properties displayed in the queue list
at the broker level. Removes the older set of dummy data values.
Modified: mgmt/cumin/python/cumin/demo.py
===================================================================
--- mgmt/cumin/python/cumin/demo.py 2007-11-02 13:45:22 UTC (rev 1210)
+++ mgmt/cumin/python/cumin/demo.py 2007-11-02 14:37:54 UTC (rev 1211)
@@ -187,10 +187,6 @@
mobject.unlock()
def frob_measure(self, measure):
- # XXX if the class_ is set, we are using real data
- if measure.class_:
- return
-
if measure.type == "int":
if random() < 0.5:
if random() < 0.66:
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-02 13:45:22 UTC (rev 1210)
+++ mgmt/cumin/python/cumin/model.py 2007-11-02 14:37:54 UTC (rev 1211)
@@ -352,8 +352,15 @@
# get recent values, with latest value at index 0
def get_values(self, limit=100):
- values = self.__values[-limit:]
- values.reverse()
+ if len(self.__values) == 0:
+ values = [0, 0]
+ else:
+ values = self.__values[-limit:]
+ values.reverse()
+
+ if len(values) == 1:
+ values.append(0)
+
return values
def get_rate(self, interval=3):
@@ -381,10 +388,6 @@
self.is_auto_delete = False
self.latency_priority = "m" # h, m, or l
- self.message_count = 41
- self.error_count = 0
- self.warning_count = 0
-
self.errors = list()
self.warnings = list()
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-11-02 13:45:22 UTC (rev 1210)
+++ mgmt/cumin/python/cumin/page.strings 2007-11-02 14:37:54 UTC (rev 1211)
@@ -395,7 +395,7 @@
float: right;
margin: 0.5em;
padding: 0.75em 1em;
- width: 15em;
+ width: 18em;
}
div.mstatus h2 {
@@ -418,6 +418,16 @@
background-color: #cfc;
}
+div.mstatus table {
+ width: 100%;
+ font-size: 0.9em;
+}
+
+div.mstatus table th, div.mstatus table td {
+ font-weight: normal;
+ text-align: left;
+}
+
div.statuslight {
float: left;
width: 1em;
@@ -522,7 +532,7 @@
width: 100%;
}
-.ralign, table.mobjects .ralign {
+.ralign, table.mobjects .ralign, div.mstatus table .ralign {
text-align: right;
}
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-02 13:45:22 UTC (rev 1210)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-02 14:37:54 UTC (rev 1211)
@@ -116,28 +116,60 @@
class QueueStatus(Widget):
def render_class(self, session, queue):
- if queue.error_count:
+ if queue.errors:
return "QueueStatus red"
- elif queue.warning_count:
+ elif queue.warnings:
return "QueueStatus yellow"
else:
return "QueueStatus green"
def render_url(self, session, queue):
return "queue.xml?id=%i" % queue.id
-
- def render_message_info(self, session, queue):
- return "%i %s in queue" % \
- (queue.message_count,
- queue.message_count == 1 and "message" or "messages")
- def render_error_info(self, session, queue):
- return "%i %s, %i %s" % \
- (queue.error_count,
- queue.error_count == 1 and "error" or "errors",
- queue.warning_count,
- queue.warning_count == 1 and "warning" or "warnings")
+ def render_consumers(self, session, queue):
+ return queue.get_measurement("consumers").get_value()
+ def render_message_enqueues(self, session, queue):
+ value = queue.get_measurement("msgTotalEnqueues").get_rate()
+ return rate(value, "msg", "sec")
+
+ def render_message_dequeues(self, session, queue):
+ value = queue.get_measurement("msgTotalDequeues").get_rate()
+ return rate(value, "msg", "sec")
+
+ def render_message_depth(self, session, queue):
+ return queue.get_measurement("msgDepth").get_value()
+
+ def render_message_depth_ratio(self, session, queue):
+ curr, prev = queue.get_measurement("msgDepth").get_values(2)
+
+ if prev != 0:
+ return "%0.00f" % (curr / float(prev))
+
+ def render_byte_enqueues(self, session, queue):
+ value = queue.get_measurement("byteTotalEnqueues").get_rate()
+ return rate(value, "byte", "sec")
+
+ def render_byte_dequeues(self, session, queue):
+ value = queue.get_measurement("byteTotalDequeues").get_rate()
+ return rate(value, "byte", "sec")
+
+ def render_byte_depth(self, session, queue):
+ return queue.get_measurement("byteDepth").get_value()
+
+ def render_byte_depth_ratio(self, session, queue):
+ curr, prev = queue.get_measurement("byteDepth").get_values(2)
+
+ if prev != 0:
+ return "%0.00f" % (curr / float(prev))
+
+# def render_error_info(self, session, queue):
+# return "%i %s, %i %s" % \
+# (queue.error_count,
+# queue.error_count == 1 and "error" or "errors",
+# queue.warning_count,
+# queue.warning_count == 1 and "warning" or "warnings")
+
class QueueView(Widget):
def __init__(self, app, name):
super(QueueView, self).__init__(app, name)
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-02 13:45:22 UTC (rev 1210)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-02 14:37:54 UTC (rev 1211)
@@ -117,14 +117,45 @@
divs.next().set(errors + ", " + warnings);
}
- wooly.setIntervalUpdate("{id}", "{url}", updateStatus, 3000);
+ //wooly.setIntervalUpdate("{id}", "{url}", updateStatus, 3000);
}())
</script>
<div class="{class} mstatus" id="{id}">
<h2>Queue Status</h2>
+<!--
<div>{message_info}</div>
<div>{error_info}</div>
+ <div>{consumers}</div>
+-->
+
+ <table>
+ <tr>
+ <th></th>
+ <th style="width: 35%;" class="ralign">Messages</th>
+ <th style="width: 35%;" class="ralign">Bytes</th>
+ </tr>
+ <tr>
+ <th>Enqueues</th>
+ <td class="ralign">{message_enqueues}</td>
+ <td class="ralign">{byte_enqueues}</td>
+ </tr>
+ <tr>
+ <th>Dequeues</th>
+ <td class="ralign">{message_dequeues}</td>
+ <td class="ralign">{byte_dequeues}</td>
+ </tr>
+ <tr>
+ <th>Depth</th>
+ <td class="ralign">{message_depth}</td>
+ <td class="ralign">{byte_depth}</td>
+ </tr>
+ <tr>
+ <th>Ratio</th>
+ <td class="ralign">{message_depth_ratio}</td>
+ <td class="ralign">{byte_depth_ratio}</td>
+ </tr>
+ </table>
</div>
[QueueView.html]
Modified: mgmt/cumin/python/cumin/util.py
===================================================================
--- mgmt/cumin/python/cumin/util.py 2007-11-02 13:45:22 UTC (rev 1210)
+++ mgmt/cumin/python/cumin/util.py 2007-11-02 14:37:54 UTC (rev 1211)
@@ -3,3 +3,9 @@
def ess(num, ending="s"):
return num != 1 and ending or ""
+
+def nvl(expr1, expr2):
+ if expr1 == None:
+ return expr2
+ else:
+ return expr1
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-02 13:45:22 UTC (rev 1210)
+++ mgmt/notes/justin-todo.txt 2007-11-02 14:37:54 UTC (rev 1211)
@@ -8,12 +8,8 @@
* exch: link bindings, producers stats to respective views
- * Make status boxes display stats like those from list views
+ * Make queue status ajaxy again
- - model: get rid of the old *_count stat fields and use the new ones
-
- * Right align status boxes?
-
Deferred
* Queue: Add created, deleted, updated timestamps
17 years, 1 month
rhmessaging commits: r1210 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-02 09:45:22 -0400 (Fri, 02 Nov 2007)
New Revision: 1210
Modified:
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/page.strings
mgmt/cumin/python/cumin/queue.py
mgmt/notes/justin-todo.txt
Log:
Reverts to dummy data until the new model lands.
Restyles select boxes a little.
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-02 13:30:43 UTC (rev 1209)
+++ mgmt/cumin/python/cumin/model.py 2007-11-02 13:45:22 UTC (rev 1210)
@@ -1,6 +1,5 @@
from wooly import *
from wooly.model import *
-from schema import *
class CuminModel(Model):
def __init__(self):
@@ -349,22 +348,13 @@
self.__low = value
def get_value(self):
- if self.class_:
- try:
- stats = self.class_.select().orderBy("recTime").reversed()[0]
- return getattr(stats, self.name, None)
- except IndexError:
- pass
- else:
- return self.__value
+ return self.__value
# get recent values, with latest value at index 0
def get_values(self, limit=100):
- if self.class_:
- stats = self.class_.select().orderBy("recTime").reversed()
- return [getattr(x, self.name) for x in stats[:limit]]
- else:
- return self.__values[-limit:]
+ values = self.__values[-limit:]
+ values.reverse()
+ return values
def get_rate(self, interval=3):
values = self.get_values(2)
@@ -400,6 +390,8 @@
# General
+ MgmtQueueStats = None
+
measure = Measurement("msgDepth", "int", MgmtQueueStats)
measure.title = "Message Depth"
measure.unit = "message"
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-11-02 13:30:43 UTC (rev 1209)
+++ mgmt/cumin/python/cumin/page.strings 2007-11-02 13:45:22 UTC (rev 1210)
@@ -362,6 +362,10 @@
float: left;
}
+select {
+ border-style: groove;
+}
+
ul.radiotabs {
list-style: none;
margin: 0 0 1em 0;
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-02 13:30:43 UTC (rev 1209)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-02 13:45:22 UTC (rev 1210)
@@ -9,8 +9,6 @@
from parameters import *
from util import *
-from schema import *
-
strings = StringCatalog(__file__)
class QueueXmlPage(Page):
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-02 13:30:43 UTC (rev 1209)
+++ mgmt/notes/justin-todo.txt 2007-11-02 13:45:22 UTC (rev 1210)
@@ -4,26 +4,22 @@
- Find/connect in bulk
- * Queue
-
- - Add a msg enq rate msg deq rate chart
-
- - Add created, deleted, updated timestamps
-
* queue: link bindings, consumers stat to respective views
* exch: link bindings, producers stats to respective views
- * model: get rid of the old *_count stat fields and use the new ones
-
* Make status boxes display stats like those from list views
- * Restyle drop boxes to not be beveled
+ - model: get rid of the old *_count stat fields and use the new ones
* Right align status boxes?
Deferred
+ * Queue: Add created, deleted, updated timestamps
+
+ * Queue: Add a msg enq rate msg deq rate chart
+
* Make the status lights also be links to an appropriate view
- Defer until we know what we're going to link to
17 years, 1 month
rhmessaging commits: r1209 - in store/trunk/cpp: lib/jrnl and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2007-11-02 09:30:43 -0400 (Fri, 02 Nov 2007)
New Revision: 1209
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/BdbMessageStore.h
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
store/trunk/cpp/lib/jrnl/jerrno.cpp
store/trunk/cpp/lib/jrnl/jerrno.hpp
store/trunk/cpp/tests/jrnl/JournalSystemTests.cpp
store/trunk/cpp/tests/jrnl/rtest
Log:
Created timer in JournalImpl that will keep calling get_events until the number of outstanding AIO events is 0.
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2007-11-01 21:00:00 UTC (rev 1208)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2007-11-02 13:30:43 UTC (rev 1209)
@@ -44,6 +44,7 @@
static const u_int8_t MESSAGE_MESSAGE = 1;
static const u_int8_t BASIC_MESSAGE = 2;
bool BdbMessageStore::useAsync;
+qpid::sys::Duration BdbMessageStore::defJournalTimeout(1000); // 1ms (timeout value is in nanoseconds)
unsigned int TxnCtxt::count = 0;
@@ -148,7 +149,7 @@
THROW_STORE_EXCEPTION("Queue already created: " + queue.getName());
}
if (usingJrnl()) {
- JournalImpl* jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue), string("JournalData"));
+ JournalImpl* jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue), string("JournalData"), defJournalTimeout);
queue.setExternalQueueStore(dynamic_cast<ExternalQueueStore*>(jQueue));
try {
// init will create the deque's for the init...
@@ -327,7 +328,7 @@
if (usingJrnl())
{
const char* queueName = queue->getName().c_str();
- JournalImpl* jQueue = new JournalImpl(queueName, getJrnlDir(queueName), string("JournalData"));
+ JournalImpl* jQueue = new JournalImpl(queueName, getJrnlDir(queueName), string("JournalData"), defJournalTimeout);
queue->setExternalQueueStore(dynamic_cast<ExternalQueueStore*>(jQueue));
try
@@ -756,13 +757,14 @@
void BdbMessageStore::flush(const qpid::broker::PersistableQueue& queue)
{
+ if (!usingJrnl()) return;
checkInit();
try {
JournalImpl* jc = static_cast<JournalImpl*>(queue.getExternalQueueStore());
if (jc){
jc->flush();
- ::usleep(10000); /////////////// hack ----------- FIX!!
- jc->get_wr_events();
+// ::usleep(10000); /////////////// hack ----------- FIX!!
+// jc->get_wr_events();
}
}catch ( journal::jexception& e) {
std::string str;
Modified: store/trunk/cpp/lib/BdbMessageStore.h
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.h 2007-11-01 21:00:00 UTC (rev 1208)
+++ store/trunk/cpp/lib/BdbMessageStore.h 2007-11-02 13:30:43 UTC (rev 1209)
@@ -34,6 +34,7 @@
#include "TxnCtxt.h"
#include <qpid/broker/MessageStore.h>
#include <qpid/sys/Monitor.h>
+#include <qpid/sys/Time.h>
#include <map>
#include <set>
#include <iostream>
@@ -75,6 +76,7 @@
std::string storeDir;
bool isInit;
const char* envPath;
+ static qpid::sys::Duration defJournalTimeout;
void recoverQueues(TxnCtxt& txn, qpid::broker::RecoveryManager& recovery, queue_index& index,
txn_list& locked, message_index& messages);
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2007-11-01 21:00:00 UTC (rev 1208)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2007-11-02 13:30:43 UTC (rev 1209)
@@ -23,17 +23,29 @@
#include "JournalImpl.h"
#include "jrnl/jerrno.hpp"
+#include <qpid/sys/Monitor.h>
using namespace rhm::bdbstore;
+using namespace rhm::journal;
+qpid::broker::TimerA JournalImpl::journalGetEventsTimer;
+
+
JournalImpl::JournalImpl(const std::string& journalId,
const std::string& journalDirectory,
- const std::string& journalBaseFilename):
- jcntl(journalId, journalDirectory, journalBaseFilename)
-{}
+ const std::string& journalBaseFilename,
+ const qpid::sys::Duration timeout):
+ jcntl(journalId, journalDirectory, journalBaseFilename),
+ timerSetFlag(false)
+{
+ fireEventPtr = new FireEvent(this, timeout);
+ journalGetEventsTimer.start();
+}
JournalImpl::~JournalImpl()
-{}
+{
+ //fireEventPtr->cancel();
+}
void
JournalImpl::recover(std::deque<journal::data_tok*>* rd_dtokl, const journal::aio_cb rd_cb,
@@ -70,3 +82,36 @@
}
}
}
+
+void
+JournalImpl::flush() throw (journal::jexception)
+{
+ jcntl::flush();
+ handleEventTimer((const iores)0);
+}
+
+void
+JournalImpl::fire()
+{
+ if (_wmgr.get_aio_evt_rem()) {
+ jcntl::get_wr_events();
+ }
+ timerSetFlag = false;
+ if (_wmgr.get_aio_evt_rem()) {
+ intrusive_ptr_add_ref(fireEventPtr.get());
+ journalGetEventsTimer.add(fireEventPtr);
+ timerSetFlag = true;
+ }
+}
+
+const iores
+JournalImpl::handleEventTimer(const iores res)
+{
+ if (_wmgr.get_aio_evt_rem() && !timerSetFlag) {
+ intrusive_ptr_add_ref(fireEventPtr.get());
+ journalGetEventsTimer.add(fireEventPtr);
+ timerSetFlag = true;
+ }
+ return res;
+}
+
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2007-11-01 21:00:00 UTC (rev 1208)
+++ store/trunk/cpp/lib/JournalImpl.h 2007-11-02 13:30:43 UTC (rev 1209)
@@ -24,21 +24,35 @@
#ifndef _JournalImpl_
#define _JournalImpl_
+#include <set>
#include "jrnl/jcntl.hpp"
#include "jrnl/data_tok.hpp"
#include "PreparedTransaction.h"
+#include <qpid/broker/Timer.h>
+#include <qpid/sys/Time.h>
#include <boost/ptr_container/ptr_list.hpp>
+#include <boost/intrusive_ptr.hpp>
namespace rhm {
namespace bdbstore {
- class JournalImpl : public journal::jcntl
- {
+ class FireEvent;
+
+ class JournalImpl : public journal::jcntl
+ {
+ private:
+ static qpid::broker::TimerA journalGetEventsTimer;
+ bool timerSetFlag;
+ qpid::broker::TimerTaskA::intrusive_ptr fireEventPtr;
+
+
public:
JournalImpl(const std::string& journalId,
const std::string& journalDirectory,
- const std::string& journalBaseFilename);
+ const std::string& journalBaseFilename,
+ const qpid::sys::Duration timeout);
~JournalImpl();
+
void recover(std::deque<journal::data_tok*>* rd_dtokl, const journal::aio_cb rd_cb,
std::deque<journal::data_tok*>* wr_dtokl, const journal::aio_cb wr_cb,
boost::ptr_list<bdbstore::PreparedTransaction>& prep_tx_list,
@@ -50,8 +64,30 @@
recover(&_aio_rd_cmpl_dtok_list, &aio_rd_callback, &_aio_wr_cmpl_dtok_list,
&aio_wr_callback, prep_tx_list, queue_id);
}
+
+ void flush() throw (journal::jexception);
+
+ // TimerTask callback
+ void fire();
+
+ private:
+ const journal::iores handleEventTimer(const journal::iores res);
};
+
+ class FireEvent : public virtual qpid::broker::TimerTaskA
+ {
+ JournalImpl* parent;
+ public:
+ FireEvent(JournalImpl* p, const qpid::sys::Duration timeout):
+ qpid::broker::TimerTaskA(timeout), parent(p) {}
+ virtual ~FireEvent() {}
+ inline void fire() { if (parent) parent->fire(); unref(); }
+ inline void cancel() { cancelled=true; parent=0; }
+ };
+
+
+
} // namespace bdbstore
} // namespace rhm
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-11-01 21:00:00 UTC (rev 1208)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-11-02 13:30:43 UTC (rev 1209)
@@ -64,7 +64,9 @@
_wrfc(),
_rmgr(this, _emap, _tmap, _rrfc),
_wmgr(this, _emap, _tmap, _wrfc)
-{}
+{
+ pthread_mutex_init(&_mutex, NULL);
+}
jcntl::~jcntl()
{
@@ -78,6 +80,7 @@
::delete _datafh[i];
::delete[] _datafh;
}
+ pthread_mutex_destroy(&_mutex);
}
void
@@ -263,7 +266,20 @@
const u_int32_t
jcntl::get_wr_events() throw (jexception)
{
- return _wmgr.get_events(pmgr::UNUSED);
+ int ret = pthread_mutex_trylock(&_mutex);
+ if (ret)
+ {
+ if (ret != EBUSY)
+ {
+ std::stringstream ss;
+ ss << "pthread_mutex_trylock() returned " << errno << " (" << strerror(errno) << ")";
+ throw jexception(jerrno::JERR__PTHREAD, ss.str(), "jcntl", "get_wr_events");
+ }
+ return 0; // already locked, return immediately
+ }
+ u_int32_t res = _wmgr.get_events(pmgr::UNUSED);
+ pthread_mutex_unlock(&_mutex);
+ return res;
}
const u_int32_t
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2007-11-01 21:00:00 UTC (rev 1208)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2007-11-02 13:30:43 UTC (rev 1209)
@@ -48,6 +48,7 @@
#include <jrnl/rmgr.hpp>
#include <jrnl/wmgr.hpp>
#include <jrnl/wrfc.hpp>
+#include <pthread.h>
#include <qpid/broker/PersistableQueue.h>
namespace rhm
@@ -138,6 +139,7 @@
rmgr _rmgr; ///< Read page manager which manages AIO
wmgr _wmgr; ///< Write page manager which manages AIO
rcvdat _rcvdat; ///< Recovery data used for recovery
+ pthread_mutex_t _mutex; ///< Mutex for tread safety
std::deque<rhm::journal::data_tok*> _aio_rd_cmpl_dtok_list; ///< Internally mamanged deque
std::deque<rhm::journal::data_tok*> _aio_wr_cmpl_dtok_list; ///< Internally mamanged deque
@@ -218,7 +220,7 @@
* \param wr_dtokl deque for storing data tokens retruning from enqueue and dequeue (write)
* AIO operations.
* \param wr_cb Function pointer to callback function for write operations. May be NULL.
- * \param prep_tx_list
+ * \param prep_txn_list
*
* \exception TODO
*/
Modified: store/trunk/cpp/lib/jrnl/jerrno.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jerrno.cpp 2007-11-01 21:00:00 UTC (rev 1208)
+++ store/trunk/cpp/lib/jrnl/jerrno.cpp 2007-11-02 13:30:43 UTC (rev 1209)
@@ -50,6 +50,7 @@
const u_int32_t jerrno::JERR__AIO = 0x0103;
const u_int32_t jerrno::JERR__FILEIO = 0x0104;
const u_int32_t jerrno::JERR__RTCLOCK = 0x0105;
+const u_int32_t jerrno::JERR__PTHREAD = 0x0106;
// class jcntl
const u_int32_t jerrno::JERR_JCNTL_STOPPED = 0x0200;
@@ -127,6 +128,7 @@
_err_map[JERR__AIO] = std::string("JERR__AIO: AIO error.");
_err_map[JERR__FILEIO] = std::string("JERR__FILEIO: File read or write failure.");
_err_map[JERR__RTCLOCK] = std::string("JERR__RTCLOCK: Reading real-time clock failed.");
+ _err_map[JERR__PTHREAD] = std::string("JERR__PTHREAD: pthread failure.");
// class jcntl
_err_map[JERR_JCNTL_STOPPED] = std::string("JERR_JCNTL_STOPPED: Operation on stopped journal.");
Modified: store/trunk/cpp/lib/jrnl/jerrno.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jerrno.hpp 2007-11-01 21:00:00 UTC (rev 1208)
+++ store/trunk/cpp/lib/jrnl/jerrno.hpp 2007-11-02 13:30:43 UTC (rev 1209)
@@ -67,6 +67,7 @@
static const u_int32_t JERR__AIO; ///< AIO failure
static const u_int32_t JERR__FILEIO; ///< File read or write failure
static const u_int32_t JERR__RTCLOCK; ///< Reading real-time clock failed
+ static const u_int32_t JERR__PTHREAD; ///< pthread failure
// class jcntl
static const u_int32_t JERR_JCNTL_STOPPED; ///< Operation on stopped journal
Modified: store/trunk/cpp/tests/jrnl/JournalSystemTests.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/JournalSystemTests.cpp 2007-11-01 21:00:00 UTC (rev 1208)
+++ store/trunk/cpp/tests/jrnl/JournalSystemTests.cpp 2007-11-02 13:30:43 UTC (rev 1209)
@@ -107,7 +107,7 @@
{
rhm::journal::jcntl jc(test_name, "jdata", test_name);
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -122,7 +122,7 @@
CPPUNIT_ASSERT_MESSAGE("Journal heap instantiation failed.", jcp != NULL);
delete jcp;
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -139,7 +139,7 @@
rhm::journal::jcntl jc(test_name, "jdata", test_name);
jc.initialize();
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -155,7 +155,7 @@
jcp->initialize();
delete jcp;
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
if (jcp)
delete jcp;
@@ -186,7 +186,7 @@
jc.recover_complete();
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -219,7 +219,7 @@
delete jcp;
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
if (jcp)
delete jcp;
@@ -240,7 +240,7 @@
for (int m=0; m<NUM_MSGS; m++)
enq_msg(&jc, create_msg(msg, m, MSG_SIZE));
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -258,7 +258,7 @@
enq_msg(jcp, create_msg(msg, m, MSG_SIZE));
delete jcp;
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
if (jcp)
delete jcp;
@@ -281,7 +281,7 @@
enq_txn_msg(&jc, create_msg(msg, m, MSG_SIZE), xid);
txn_commit(&jc, xid);
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -300,7 +300,7 @@
txn_commit(jcp, xid);
delete jcp;
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
if (jcp)
delete jcp;
@@ -335,7 +335,7 @@
}
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -370,7 +370,7 @@
delete jcp;
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
if (jcp)
delete jcp;
@@ -408,7 +408,7 @@
}
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -444,7 +444,7 @@
delete jcp;
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
if (jcp)
delete jcp;
@@ -487,7 +487,7 @@
}
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -529,7 +529,7 @@
delete jcp;
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
if (jcp)
delete jcp;
@@ -575,7 +575,7 @@
}
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -618,7 +618,7 @@
delete jcp;
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
if (jcp)
delete jcp;
@@ -663,7 +663,7 @@
deq_msg(&jc, m);
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -707,7 +707,7 @@
delete jcp;
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
if (jcp)
delete jcp;
@@ -755,7 +755,7 @@
deq_msg(&jc, m);
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -800,7 +800,7 @@
delete jcp;
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
if (jcp)
delete jcp;
@@ -871,7 +871,7 @@
deq_msg(&jc, m);
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -941,7 +941,7 @@
delete jcp;
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
if (jcp)
delete jcp;
@@ -1019,7 +1019,7 @@
deq_msg(&jc, m);
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
std::stringstream ss;
ss << e;
@@ -1095,7 +1095,7 @@
delete jcp;
}
}
- catch (rhm::journal::jexception& e)
+ catch (const rhm::journal::jexception& e)
{
if (jcp)
delete jcp;
Modified: store/trunk/cpp/tests/jrnl/rtest
===================================================================
--- store/trunk/cpp/tests/jrnl/rtest 2007-11-01 21:00:00 UTC (rev 1208)
+++ store/trunk/cpp/tests/jrnl/rtest 2007-11-02 13:30:43 UTC (rev 1209)
@@ -58,8 +58,8 @@
RM_DIR="${RM} -rf"
TEST_PROG="./jtest"
CHK_PROG="./janalyze.py"
-#VALGRIND="valgrind -q --track-fds=yes --leak-check=full --leak-resolution=high --show-reachable=yes"
-VALGRIND="valgrind -q --track-fds=yes --leak-check=full --leak-resolution=high --show-reachable=yes --suppressions=/usr/lib/valgrind/glibc-2.5.supp"
+VALGRIND="valgrind -q --track-fds=yes --leak-check=full --leak-resolution=high --show-reachable=yes"
+#VALGRIND="valgrind -q --track-fds=yes --leak-check=full --leak-resolution=high --show-reachable=yes --suppressions=/usr/lib/valgrind/glibc-2.5.supp"
MAKE="make -f Makefile.rtest"
17 years, 1 month
rhmessaging commits: r1208 - mgmt/notes.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-01 17:00:00 -0400 (Thu, 01 Nov 2007)
New Revision: 1208
Modified:
mgmt/notes/justin-todo.txt
Log:
Todo list updates.
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-01 19:41:40 UTC (rev 1207)
+++ mgmt/notes/justin-todo.txt 2007-11-01 21:00:00 UTC (rev 1208)
@@ -6,12 +6,8 @@
* Queue
- - Split queues view into bytes and messages modes
-
- Add a msg enq rate msg deq rate chart
- - Rate of accel, decel for enq, deq
-
- Add created, deleted, updated timestamps
* queue: link bindings, consumers stat to respective views
17 years, 1 month
rhmessaging commits: r1207 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-01 15:41:40 -0400 (Thu, 01 Nov 2007)
New Revision: 1207
Modified:
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
Log:
Adds radio buttons to the queue list for switching between bytes and
messages stats.
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-01 18:59:46 UTC (rev 1206)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-01 19:41:40 UTC (rev 1207)
@@ -32,9 +32,32 @@
return writer.to_string()
class QueueSet(ItemSet):
+ def __init__(self, app, name):
+ super(QueueSet, self).__init__(app, name)
+
+ self.unit = Parameter(app, "unit")
+ self.unit.set_default("m")
+ self.add_parameter(self.unit)
+
def render_title(self, session, vhost):
return "Queues (%s)" % len(vhost.queue_items())
+ def render_messages_link(self, session, vhost):
+ branch = session.branch()
+ self.unit.set(branch, "m")
+
+ class_ = self.unit.get(session) == "m" and "selected"
+
+ return link(branch.marshal(), "Messages", class_)
+
+ def render_bytes_link(self, session, vhost):
+ branch = session.branch()
+ self.unit.set(branch, "b")
+
+ class_ = self.unit.get(session) == "b" and "selected"
+
+ return link(branch.marshal(), "Bytes", class_)
+
def get_items(self, session, vhost):
return sorted_by(vhost.queue_items())
@@ -53,21 +76,27 @@
return len(queue.binding_items())
def render_item_enqueues(self, session, queue):
- value = queue.get_measurement("msgTotalEnqueues").get_rate()
- return rate(value, "msg", "sec")
+ unit = self.unit.get(session)
+ key = unit == "b" and "byteTotalEnqueues" or "msgTotalEnqueues"
+ value = queue.get_measurement(key).get_rate()
+ return rate(value, unit == "b" and "byte" or "msg", "sec")
def render_item_dequeues(self, session, queue):
- value = queue.get_measurement("msgTotalDequeues").get_rate()
- return rate(value, "msg", "sec")
+ unit = self.unit.get(session)
+ key = unit == "b" and "byteTotalDequeues" or "msgTotalDequeues"
+ value = queue.get_measurement(key).get_rate()
+ return rate(value, unit == "b" and "byte" or "msg", "sec")
def render_item_depth(self, session, queue):
- return queue.get_measurement("msgDepth").get_value()
+ key = self.unit.get(session) == "b" and "byteDepth" or "msgDepth"
+ return queue.get_measurement(key).get_value()
def render_item_ratio(self, session, queue):
- values = queue.get_measurement("msgDepth").get_values(2)
+ key = self.unit.get(session) == "b" and "byteDepth" or "msgDepth"
+ values = queue.get_measurement(key).get_values(2)
if len(values) > 1 and values[0] != None:
- return "%0.00f" % (values[1] - values[0] / 3)
+ return "%0.00f" % (values[0] - values[1] / 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 18:59:46 UTC (rev 1206)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-01 19:41:40 UTC (rev 1207)
@@ -7,6 +7,11 @@
[QueueSet.html]
<form action="{href}" method="get">
+ <ul class="radiotabs">
+ <li>{messages_link}</li>
+ <li>{bytes_link}</li>
+ </ul>
+
<div class="sactions">
<h2>Act on Selected Queues:</h2>
<button>Purge Messages</button>
17 years, 1 month