rhmessaging commits: r1347 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-20 16:34:39 -0500 (Tue, 20 Nov 2007)
New Revision: 1347
Modified:
mgmt/cumin/python/cumin/queue.py
Log:
Restores rates to working.
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-20 21:24:45 UTC (rev 1346)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-20 21:34:39 UTC (rev 1347)
@@ -120,34 +120,34 @@
return queue.stats.consumers
def render_messages_enqueued(self, session, queue):
- value = queue.stats.msgTotalEnqueues
- return fmt_rate(value, "msg", "sec")
+ stat = self.app.cmodel.queue.get_stat("msgTotalEnqueues")
+ return fmt_rate(stat.rate(queue), "msg", "sec")
def render_messages_dequeued(self, session, queue):
- value = queue.stats.msgTotalDequeues
- return fmt_rate(value, "msg", "sec")
+ stat = self.app.cmodel.queue.get_stat("msgTotalDequeues")
+ return fmt_rate(stat.rate(queue), "msg", "sec")
def render_message_depth(self, session, queue):
return queue.stats.msgDepth
def render_message_depth_accel(self, session, queue):
- value = queue.stats.msgDepth
- return fmt_rate(value, "msg", "sec")
+ stat = self.app.cmodel.queue.get_stat("msgDepth")
+ return fmt_rate(stat.rate(queue), "msg", "sec")
def render_bytes_enqueued(self, session, queue):
- value = queue.stats.byteTotalEnqueues
- return fmt_rate(value, "byte", "sec")
+ stat = self.app.cmodel.queue.get_stat("byteTotalEnqueues")
+ return fmt_rate(stat.rate(queue), "byte", "sec")
def render_bytes_dequeued(self, session, queue):
- value = queue.stats.byteTotalDequeues
- return fmt_rate(value, "byte", "sec")
+ stat = self.app.cmodel.queue.get_stat("byteTotalDequeues")
+ return fmt_rate(stat.rate(queue), "byte", "sec")
def render_byte_depth(self, session, queue):
return queue.stats.byteDepth
def render_byte_depth_accel(self, session, queue):
- value = queue.stats.byteDepth
- return fmt_rate(value, "byte", "sec")
+ stat = self.app.cmodel.queue.get_stat("byteDepth")
+ return fmt_rate(stat.rate(queue), "byte", "sec")
class QueueView(Widget):
def __init__(self, app, name):
18 years, 5 months
rhmessaging commits: r1346 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-20 16:24:45 -0500 (Tue, 20 Nov 2007)
New Revision: 1346
Modified:
mgmt/cumin/python/cumin/widgets.py
Log:
Turn status back on, though without proper data.
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2007-11-20 21:21:40 UTC (rev 1345)
+++ mgmt/cumin/python/cumin/widgets.py 2007-11-20 21:24:45 UTC (rev 1346)
@@ -142,13 +142,12 @@
return "mstatus green"
def render_status_info(self, session, object):
- if hasattr(object, "errors"):
- 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))
+ error_count = 0 #XXX len(object.errors)
+ warning_count = 0 #XXX len(object.warnings)
+
+ return "%i error%s, %i warning%s" % \
+ (error_count, ess(error_count),
+ warning_count, ess(warning_count))
class CuminChartPage(Page):
def __init__(self, app, name):
18 years, 5 months
rhmessaging commits: r1345 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-20 16:21:40 -0500 (Tue, 20 Nov 2007)
New Revision: 1345
Modified:
mgmt/cumin/python/cumin/model.py
Log:
For now use -1 to indicate no data in stats.
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-20 21:01:25 UTC (rev 1344)
+++ mgmt/cumin/python/cumin/model.py 2007-11-20 21:21:40 UTC (rev 1345)
@@ -2,6 +2,8 @@
from wooly import *
from wooly.model import *
+from util import *
+
class CuminModel(object):
def __init__(self):
self.classes = dict()
@@ -48,7 +50,7 @@
self.highlow = False
def value(self, object):
- return getattr(object.stats, self.name)
+ return nvl(getattr(object.stats, self.name), -1)
def rate(self, object):
if object.stats:
@@ -59,6 +61,12 @@
if curr is not None and prev is not None:
return (curr - prev) / float(1)
+ else:
+ return -1
+ else:
+ return -1
+ else:
+ return -1
def write_xml(self, object, writer):
writer.write("<stat name=\"%s\" value=\"%i\" rate=\"%i\"/>" \
18 years, 5 months
rhmessaging commits: r1344 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-20 16:01:25 -0500 (Tue, 20 Nov 2007)
New Revision: 1344
Modified:
mgmt/cumin/python/cumin/page.strings
Log:
Switch to using the right icon for help buttons.
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-11-20 20:52:02 UTC (rev 1343)
+++ mgmt/cumin/python/cumin/page.strings 2007-11-20 21:01:25 UTC (rev 1344)
@@ -359,11 +359,11 @@
form.mform a.help {
float: left;
margin: 0.5em;
- padding: 0.25em 0.25em 0 0.25em;
+ padding: 0.25em 0.35em 0 0.5em;
}
form.mform a.help:before {
- content: url(resource?name=notice-20.png);
+ content: url(resource?name=help-20.png);
padding: 0 0.25em 0 0;
vertical-align: -35%;
}
18 years, 5 months
rhmessaging commits: r1343 - in mgmt/cumin/python: wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-20 15:52:02 -0500 (Tue, 20 Nov 2007)
New Revision: 1343
Modified:
mgmt/cumin/python/cumin/page.strings
mgmt/cumin/python/cumin/widgets.py
mgmt/cumin/python/wooly/forms.strings
Log:
Adds icons to form buttons.
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-11-20 20:22:42 UTC (rev 1342)
+++ mgmt/cumin/python/cumin/page.strings 2007-11-20 20:52:02 UTC (rev 1343)
@@ -353,12 +353,33 @@
form.mform button, form.mform a.help {
margin: 0.5em;
+ padding: 0.25em 0.25em 0 0.25em;
}
form.mform a.help {
float: left;
+ margin: 0.5em;
+ padding: 0.25em 0.25em 0 0.25em;
}
+form.mform a.help:before {
+ content: url(resource?name=notice-20.png);
+ padding: 0 0.25em 0 0;
+ vertical-align: -35%;
+}
+
+form.mform button.cancel:before {
+ content: url(resource?name=cancel-20.png);
+ padding: 0 0.25em 0 0;
+ vertical-align: -35%;
+}
+
+form.mform button.submit:before {
+ content: url(resource?name=submit-20.png);
+ padding: 0 0.25em 0 0;
+ vertical-align: -35%;
+}
+
select {
border-style: groove;
}
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2007-11-20 20:22:42 UTC (rev 1342)
+++ mgmt/cumin/python/cumin/widgets.py 2007-11-20 20:52:02 UTC (rev 1343)
@@ -112,10 +112,16 @@
return "Submit"
class Cancel(FormButton):
+ def render_class(self, session, object):
+ return "cancel"
+
def render_content(self, session, object):
return self.parent().render_cancel_content(session, object)
class Submit(FormButton):
+ def render_class(self, session, object):
+ return "submit"
+
def render_content(self, session, object):
return self.parent().render_submit_content(session, object)
Modified: mgmt/cumin/python/wooly/forms.strings
===================================================================
--- mgmt/cumin/python/wooly/forms.strings 2007-11-20 20:22:42 UTC (rev 1342)
+++ mgmt/cumin/python/wooly/forms.strings 2007-11-20 20:52:02 UTC (rev 1343)
@@ -1,5 +1,5 @@
[FormButton.html]
-<button id="{id}" type="submit" name="{name}" value="{value}" tabindex="{tab_index}" {disabled_attr}>{content}</button>
+<button class="{class}" id="{id}" type="submit" name="{name}" value="{value}" tabindex="{tab_index}" {disabled_attr}>{content}</button>
[FormInput.errors_html]
<ul class="errors">{error_messages}</ul>
18 years, 5 months
rhmessaging commits: r1342 - in mgmt/cumin: resources and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-20 15:22:42 -0500 (Tue, 20 Nov 2007)
New Revision: 1342
Added:
mgmt/cumin/resources/action-20.png
mgmt/cumin/resources/action-36.png
mgmt/cumin/resources/broker-20.png
mgmt/cumin/resources/broker-36.png
mgmt/cumin/resources/client-20.png
mgmt/cumin/resources/client-36.png
mgmt/cumin/resources/cluster-20.png
mgmt/cumin/resources/cluster-36.png
mgmt/cumin/resources/profile-20.png
mgmt/cumin/resources/profile-36.png
mgmt/cumin/resources/system-20.png
mgmt/cumin/resources/system-36.png
Modified:
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/broker.strings
mgmt/cumin/python/cumin/brokercluster.py
mgmt/cumin/python/cumin/brokercluster.strings
mgmt/cumin/python/cumin/brokergroup.py
mgmt/cumin/python/cumin/brokerprofile.strings
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/client.strings
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/exchange.strings
mgmt/cumin/python/cumin/formats.py
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/resources/exchange-20.png
mgmt/cumin/resources/exchange-36.png
mgmt/cumin/resources/queue-20.png
mgmt/cumin/resources/queue-36.png
Log:
Adds newest icons.
Updates name formatter.
More fixups for data model integration.
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/broker.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -58,7 +58,7 @@
return fmt_none()
def render_item_status(self, session, broker):
- return None #fmt_status(len(broker.errors), len(broker.warnings))
+ return fmt_ostatus(broker)
def render_item_load(self, session, broker):
return "%.2f" % random()
Modified: mgmt/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/cumin/python/cumin/broker.strings 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/broker.strings 2007-11-20 20:22:42 UTC (rev 1342)
@@ -144,7 +144,7 @@
[BrokerView.html]
{status}
-<h1>{title}</h1>
+<h1><img src="resource?name=broker-36.png"/>{title}</h1>
<table class="props">
<tr><th>Name</th><td>{name}</td></tr>
Modified: mgmt/cumin/python/cumin/brokercluster.py
===================================================================
--- mgmt/cumin/python/cumin/brokercluster.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/brokercluster.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -37,7 +37,7 @@
writer = Writer()
for broker in sorted_by(cluster.broker_items()):
- writer.write(fmt_status(len(broker.errors), len(broker.warnings)))
+ writer.write(fmt_ostatus(broker))
return writer.to_string()
Modified: mgmt/cumin/python/cumin/brokercluster.strings
===================================================================
--- mgmt/cumin/python/cumin/brokercluster.strings 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/brokercluster.strings 2007-11-20 20:22:42 UTC (rev 1342)
@@ -40,7 +40,7 @@
[BrokerClusterView.html]
{status}
-<h1>{title}</h1>
+<h1><img src="resource?name=cluster-36.png"/>{title}</h1>
<table class="props">
<tr><th>Name</th><td>{name}</td></tr>
Modified: mgmt/cumin/python/cumin/brokergroup.py
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/brokergroup.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -35,7 +35,7 @@
writer = Writer()
for broker in sorted_by(group.broker_items()):
- writer.write(fmt_status(len(broker.errors), len(broker.warnings)))
+ writer.write(fmt_ostatus(broker))
return writer.to_string()
Modified: mgmt/cumin/python/cumin/brokerprofile.strings
===================================================================
--- mgmt/cumin/python/cumin/brokerprofile.strings 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/brokerprofile.strings 2007-11-20 20:22:42 UTC (rev 1342)
@@ -17,7 +17,7 @@
</tr>
[BrokerProfileView.html]
-<h1>{title}</h1>
+<h1><img src="resource?name=profile-36.png"/> {title}</h1>
<table class="props">
<tr><th>Name</th><td>{name}</td></tr>
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/client.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -49,7 +49,7 @@
return fmt_rate(value, unit == "b" and "byte" or "msg", "sec")
def render_item_status(self, session, client):
- return None #XXX fmt_status(len(client.errors), len(client.warnings))
+ return fmt_ostatus(client)
class ClientFrame(CuminFrame):
def __init__(self, app, name):
@@ -172,7 +172,7 @@
return fmt_predicate(value)
def render_item_status(self, session, session_):
- return None #XXX fmt_status(len(session_.errors), len(session_.warnings))
+ return fmt_ostatus(session_)
class ClientXmlPage(CuminXmlPage):
def __init__(self, app, name):
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/client.strings 2007-11-20 20:22:42 UTC (rev 1342)
@@ -98,7 +98,7 @@
{status}
-<h1>{title}</h1>
+<h1><img src="client-36.png"/>{title}</h1>
<table class="props">
<tr><th>Address</th><td>{address}</td></tr>
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/exchange.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -83,7 +83,7 @@
return getattr(exchange.mintExchangeStats, key)
def render_item_status(self, session, exchange):
- return None #XXX fmt_status(len(exchange.errors), len(exchange.warnings))
+ return fmt_ostatus(exchange)
def show_producers(page, session, exchange):
frame = page.show_exchange(session, exchange).show_view(session)
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/exchange.strings 2007-11-20 20:22:42 UTC (rev 1342)
@@ -154,7 +154,7 @@
{status}
-<h1><img src="resource?name=exchange-36.png"> {title}</h1>
+<h1><img src="resource?name=exchange-36.png"/>{title}</h1>
<table class="props">
<tr><th>Name</th><td>{name}</td></tr>
Modified: mgmt/cumin/python/cumin/formats.py
===================================================================
--- mgmt/cumin/python/cumin/formats.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/formats.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -30,7 +30,7 @@
def fmt_rate(value, unit1, unit2):
#return "%i <small>%s/%s</small>" % (value, unit1, unit2)
- return "%i<small>/%s</small>" % (value, unit2)
+ return "%i<small>/%s</small>" % (nvl(value, 0), unit2)
def fmt_predicate(predicate):
return predicate and "Yes" or "No"
@@ -55,12 +55,17 @@
return "<div class=\"statuslight %s\">%s</div>" % (class_, number)
+def fmt_ostatus(object):
+ return fmt_status(0, 0)
+
def fmt_none():
return "<span class=\"none\">None</span>"
def fmt_shorten(string):
if len(string) > 15:
return string[:10] + "..." + string[-5:]
+ else:
+ return string
def fmt_link(href, content, class_=""):
return "<a href=\"%s\"%s>%s</a>" % \
Modified: mgmt/cumin/python/cumin/measurement.py
===================================================================
--- mgmt/cumin/python/cumin/measurement.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/measurement.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -53,9 +53,7 @@
def render_item_extra(self, session, args):
stat, object = args
- return None #XXX
-
- if stat.highlow:
+ if False and stat.highlow: #XXX
return "<small>high</small> <span>%i</span> " + \
"<small>low</small> <span>%i</span>" \
% (stat.high(object) or 0, stat.low(object) or 0)
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/model.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -51,8 +51,15 @@
return getattr(object.stats, self.name)
def rate(self, object):
- return getattr(object.stats, self.name)
+ if object.stats:
+ curr = getattr(object.stats, self.name)
+ if object.statsPrev:
+ prev = getattr(object.statsPrev, self.name)
+
+ if curr is not None and prev is not None:
+ return (curr - prev) / float(1)
+
def write_xml(self, object, writer):
writer.write("<stat name=\"%s\" value=\"%i\" rate=\"%i\"/>" \
% (self.name,
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -77,7 +77,7 @@
return fmt_rate(value, unit == "b" and "byte" or "msg", "sec")
def render_item_status(self, session, queue):
- return None #fmt_status(len(queue.errors), len(queue.warnings))
+ return fmt_ostatus(queue)
def show_consumers(page, session, queue):
frame = page.show_queue(session, queue).show_view(session)
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-20 20:22:42 UTC (rev 1342)
@@ -168,7 +168,7 @@
{status}
-<h1><img src="resource?name=queue-36.png"> {title}</h1>
+<h1><img src="resource?name=queue-36.png"/>{title}</h1>
<table class="props">
<tr><th>Name</th><td>{name}</td></tr>
Added: mgmt/cumin/resources/action-20.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/action-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/action-36.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/action-36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/broker-20.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/broker-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/broker-36.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/broker-36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/client-20.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/client-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/client-36.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/client-36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/cluster-20.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/cluster-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/cluster-36.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/cluster-36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: mgmt/cumin/resources/exchange-20.png
===================================================================
(Binary files differ)
Modified: mgmt/cumin/resources/exchange-36.png
===================================================================
(Binary files differ)
Added: mgmt/cumin/resources/profile-20.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/profile-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/profile-36.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/profile-36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: mgmt/cumin/resources/queue-20.png
===================================================================
(Binary files differ)
Modified: mgmt/cumin/resources/queue-36.png
===================================================================
(Binary files differ)
Added: mgmt/cumin/resources/system-20.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/system-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/system-36.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/system-36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
18 years, 5 months
rhmessaging commits: r1341 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2007-11-20 15:03:47 -0500 (Tue, 20 Nov 2007)
New Revision: 1341
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
Log:
Tidied up the exception messages translated from jexception into StoreException
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2007-11-20 18:44:46 UTC (rev 1340)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2007-11-20 20:03:47 UTC (rev 1341)
@@ -190,7 +190,7 @@
journal::jdir::delete_dir(getJrnlBaseDir(),true);
}
catch ( journal::jexception& e) {
- THROW_STORE_EXCEPTION(std::string("Truncate clean up failed: ") + e.what() );
+ THROW_STORE_EXCEPTION(std::string("truncate() failed: ") + e.what() );
}
}
@@ -207,7 +207,7 @@
// init will create the deque's for the init...
jQueue->initialize();
} catch (journal::jexception& e) {
- THROW_STORE_EXCEPTION(e.what() + queue.getName());
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue.getName() + ": create() failed: " + e.what());
}
}
@@ -388,7 +388,7 @@
recoverMessages(txn, registry, queue, prepared, messages);
jQueue->recover_complete(); // start journal.
} catch (const journal::jexception& e) {
- THROW_STORE_EXCEPTION(std::string(e.what()) + queueName);
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queueName + ": recoverQueues() failed: " + e.what());
}
//read all messages: done on a per queue basis if using Journal
}
@@ -546,12 +546,10 @@
} // switch
} // while
} catch (rhm::journal::jexception& e) {
- std::stringstream ss;
- ss << e;
- THROW_STORE_EXCEPTION("Error dequeuing message: " + ss.str());
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue->getName() +
+ ": recoverMessages() failed: " + e.what());
}
messageIdSequence.reset(maxMessageId + 1);
-
}
RecoverableMessage::shared_ptr BdbMessageStore::getExternMessage(qpid::broker::RecoveryManager& recovery,
@@ -841,7 +839,8 @@
} catch (DbException& e) {
THROW_STORE_EXCEPTION_2("Error loading content", e);
} catch (journal::jexception& e) {
- THROW_STORE_EXCEPTION("Error loading content" /*, e*/);
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue.getName() +
+ ": loadContent() failed: " + e.what());
}
} else {
THROW_STORE_EXCEPTION("Cannot load content. Message not known to store!");
@@ -858,7 +857,7 @@
jc->flush();
}
}catch ( journal::jexception& e) {
- THROW_STORE_EXCEPTION(std::string("Flush failed: ") + e.what() );
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue.getName() + ": flush() failed: " + e.what() );
}
}
@@ -988,8 +987,8 @@
}
}
}catch ( journal::jexception& e) {
-// std::cout << "-------------" << e << std::endl;
- THROW_STORE_EXCEPTION(std::string("Enqueue failed: ") + e.what() );
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue->getName() + ": store() failed: " +
+ e.what());
}catch (DbException& e) {
THROW_STORE_EXCEPTION_2("Error storing message", e);
}
@@ -1085,7 +1084,7 @@
dres = jc->dequeue_txn_data_record(ddtokp.get(), tid);
}
} catch (rhm::journal::jexception& e) {
- THROW_STORE_EXCEPTION(std::string("Error dequeuing message") + e.what());
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue.getName() + ": async_dequeue() failed: " + e.what());
}
switch (dres)
{
18 years, 5 months
rhmessaging commits: r1340 - in store/trunk/cpp: tests/jrnl and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2007-11-20 13:44:46 -0500 (Tue, 20 Nov 2007)
New Revision: 1340
Modified:
store/trunk/cpp/lib/jrnl/jerrno.cpp
store/trunk/cpp/lib/jrnl/jerrno.hpp
store/trunk/cpp/lib/jrnl/jexception.cpp
store/trunk/cpp/tests/jrnl/unit_test_jexception.cpp
Log:
Additional tidy-up for jexception class and an additional error code for jerrno.
Modified: store/trunk/cpp/lib/jrnl/jerrno.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jerrno.cpp 2007-11-20 13:58:23 UTC (rev 1339)
+++ store/trunk/cpp/lib/jrnl/jerrno.cpp 2007-11-20 18:44:46 UTC (rev 1340)
@@ -58,6 +58,7 @@
const u_int32_t jerrno::JERR_JCNTL_AIOCMPLWAIT = 0x0202;
const u_int32_t jerrno::JERR_JCNTL_UNKNOWNMAGIC = 0x0203;
const u_int32_t jerrno::JERR_JCNTL_NOTRECOVERED = 0x0204;
+const u_int32_t jerrno::JERR_JCNTL_RECOVERJFULL = 0x0205;
// class jdir
const u_int32_t jerrno::JERR_JDIR_NOTDIR = 0x0300;
@@ -139,6 +140,8 @@
_err_map[JERR_JCNTL_UNKNOWNMAGIC] = "JERR_JCNTL_UNKNOWNMAGIC: Found record with unknown magic.";
_err_map[JERR_JCNTL_NOTRECOVERED] = "JERR_JCNTL_NOTRECOVERED: "
"Operation requires recover() to be run first.";
+ _err_map[JERR_JCNTL_RECOVERJFULL] = "JERR_JCNTL_RECOVERJFULL: "
+ "Journal data files full, cannot write.";
// class jdir
_err_map[JERR_JDIR_NOTDIR] = "JERR_JDIR_NOTDIR: Directory name exists but is not a directory.";
Modified: store/trunk/cpp/lib/jrnl/jerrno.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jerrno.hpp 2007-11-20 13:58:23 UTC (rev 1339)
+++ store/trunk/cpp/lib/jrnl/jerrno.hpp 2007-11-20 18:44:46 UTC (rev 1340)
@@ -75,6 +75,7 @@
static const u_int32_t JERR_JCNTL_AIOCMPLWAIT; ///< Timeout waiting for AIOs to complete
static const u_int32_t JERR_JCNTL_UNKNOWNMAGIC; ///< Found record with unknown magic
static const u_int32_t JERR_JCNTL_NOTRECOVERED; ///< Req' recover() to be called first
+ static const u_int32_t JERR_JCNTL_RECOVERJFULL; ///< Journal data files full, cannot write
// class jdir
static const u_int32_t JERR_JDIR_NOTDIR; ///< Exists but is not a directory
Modified: store/trunk/cpp/lib/jrnl/jexception.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jexception.cpp 2007-11-20 13:58:23 UTC (rev 1339)
+++ store/trunk/cpp/lib/jrnl/jexception.cpp 2007-11-20 18:44:46 UTC (rev 1340)
@@ -58,7 +58,8 @@
std::exception(),
_err_code(err_code)
{
- ::sprintf(_what_msg, "jexception 0x%04X", err_code);
+ ::sprintf(_what_msg, "jexception 0x%04X ", err_code);
+ ::strncat(_what_msg, jerrno::err_msg(err_code), CATLEN(_what_msg));
*_additional_info = '\0';
*_throwing_class = '\0';
*_throwing_fn = '\0';
@@ -86,11 +87,14 @@
_err_code(err_code)
{
::sprintf(_what_msg, "jexception 0x%04X ", err_code);
+ ::strncat(_what_msg, jerrno::err_msg(err_code), CATLEN(_what_msg));
if (additional_info)
{
::strncpy(_additional_info, additional_info, MAX_MSG_SIZE - 1);
_additional_info[MAX_MSG_SIZE - 1] = '\0';
+ ::strncat(_what_msg, " (", CATLEN(_what_msg));
::strncat(_what_msg, _additional_info, CATLEN(_what_msg));
+ ::strncat(_what_msg, ")", CATLEN(_what_msg));
}
else
*_additional_info = '\0';
@@ -112,6 +116,8 @@
::strncat(_what_msg, _throwing_class, CATLEN(_what_msg));
if (throwing_fn)
::strncat(_what_msg, "::", CATLEN(_what_msg));
+ else
+ ::strncat(_what_msg, " ", CATLEN(_what_msg));
}
else
*_throwing_class = '\0';
@@ -120,9 +126,13 @@
::strncpy(_throwing_fn, throwing_fn, MAX_THROWING_SIZE - 1);
_throwing_fn[MAX_THROWING_SIZE - 1] = '\0';
::strncat(_what_msg, _throwing_fn, CATLEN(_what_msg));
+ ::strncat(_what_msg, "() ", CATLEN(_what_msg));
}
else
*_throwing_fn = '\0';
+ if (throwing_class || throwing_fn)
+ ::strncat(_what_msg, "threw ", CATLEN(_what_msg));
+ ::strncat(_what_msg, jerrno::err_msg(err_code), CATLEN(_what_msg));
}
jexception::jexception(const u_int32_t err_code, const char* additional_info,
@@ -138,7 +148,7 @@
::strncat(_what_msg, _throwing_class, CATLEN(_what_msg));
if (throwing_fn)
::strncat(_what_msg, "::", CATLEN(_what_msg));
- else if (additional_info)
+ else
::strncat(_what_msg, " ", CATLEN(_what_msg));
}
else
@@ -148,16 +158,20 @@
::strncpy(_throwing_fn, throwing_fn, MAX_THROWING_SIZE - 1);
_throwing_fn[MAX_THROWING_SIZE - 1] = '\0';
::strncat(_what_msg, _throwing_fn, CATLEN(_what_msg));
- if (additional_info)
- ::strncat(_what_msg, " ", CATLEN(_what_msg));
+ ::strncat(_what_msg, "() ", CATLEN(_what_msg));
}
else
*_throwing_fn = '\0';
+ if (throwing_class || throwing_fn)
+ ::strncat(_what_msg, "threw ", CATLEN(_what_msg));
+ ::strncat(_what_msg, jerrno::err_msg(err_code), CATLEN(_what_msg));
if (additional_info)
{
::strncpy(_additional_info, additional_info, MAX_MSG_SIZE - 1);
_additional_info[MAX_MSG_SIZE - 1] = '\0';
+ ::strncat(_what_msg, " (", CATLEN(_what_msg));
::strncat(_what_msg, _additional_info, CATLEN(_what_msg));
+ ::strncat(_what_msg, ")", CATLEN(_what_msg));
}
else
*_additional_info = '\0';
Modified: store/trunk/cpp/tests/jrnl/unit_test_jexception.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/unit_test_jexception.cpp 2007-11-20 13:58:23 UTC (rev 1339)
+++ store/trunk/cpp/tests/jrnl/unit_test_jexception.cpp 2007-11-20 18:44:46 UTC (rev 1340)
@@ -33,6 +33,7 @@
#include <boost/test/unit_test.hpp>
#include <boost/test/unit_test_log.hpp>
#include <iostream>
+#include <jrnl/jerrno.hpp>
#include <jrnl/jexception.hpp>
using namespace boost::unit_test;
@@ -261,15 +262,18 @@
throw_exception(jexception((const char*)NULL), 11, 0);
throw_exception(jexception(0x1234, long_msg), MAX_MSG_SIZE - 1, MAX_MSG_SIZE - 1);
- throw_exception(jexception(0x1234, NULL), 18, 0);
+ throw_exception(jexception(0x1234, NULL), 18 + ::strlen(jerrno::err_msg(0x1234)), 0);
throw_exception(jexception(0x1234, long_throwing_class, long_throwing_fn),
- (2 * (MAX_THROWING_SIZE - 1)) + 20, MAX_THROWING_SIZE - 1, MAX_THROWING_SIZE - 1);
- throw_exception(jexception(0x1234, long_throwing_class, NULL), MAX_THROWING_SIZE - 1 + 18,
- MAX_THROWING_SIZE - 1, 0);
- throw_exception(jexception(0x1234, NULL, long_throwing_fn), MAX_THROWING_SIZE - 1 + 18, 0,
+ 29 + (2 * (MAX_THROWING_SIZE - 1)) + ::strlen(jerrno::err_msg(0x1234)),
+ MAX_THROWING_SIZE - 1, MAX_THROWING_SIZE - 1);
+ throw_exception(jexception(0x1234, long_throwing_class, NULL),
+ 25 + MAX_THROWING_SIZE - 1 + ::strlen(jerrno::err_msg(0x1234)), MAX_THROWING_SIZE - 1,
+ 0);
+ throw_exception(jexception(0x1234, NULL, long_throwing_fn),
+ 27 + MAX_THROWING_SIZE - 1 + ::strlen(jerrno::err_msg(0x1234)), 0,
MAX_THROWING_SIZE - 1);
- throw_exception(jexception(0x1234, NULL, NULL), 18, 0, 0);
+ throw_exception(jexception(0x1234, NULL, NULL), 18 + ::strlen(jerrno::err_msg(0x1234)), 0, 0);
throw_exception(jexception(0x1234, long_msg, long_throwing_class, long_throwing_fn),
MAX_MSG_SIZE - 1, MAX_MSG_SIZE - 1, MAX_THROWING_SIZE - 1, MAX_THROWING_SIZE - 1);
@@ -280,12 +284,16 @@
throw_exception(jexception(0x1234, long_msg, NULL, NULL), MAX_MSG_SIZE - 1, MAX_MSG_SIZE - 1, 0,
0);
throw_exception(jexception(0x1234, NULL, long_throwing_class, long_throwing_fn),
- (2 * (MAX_THROWING_SIZE - 1)) + 20, 0, MAX_THROWING_SIZE - 1, MAX_THROWING_SIZE - 1);
- throw_exception(jexception(0x1234, NULL, long_throwing_class, NULL), MAX_THROWING_SIZE - 1 + 18,
- 0, MAX_THROWING_SIZE - 1, 0);
- throw_exception(jexception(0x1234, NULL, NULL, long_throwing_fn), MAX_THROWING_SIZE - 1 + 18, 0,
- 0, MAX_THROWING_SIZE - 1);
- throw_exception(jexception(0x1234, NULL, NULL, NULL), 18, 0, 0, 0);
+ 29 + (2 * (MAX_THROWING_SIZE - 1)) + ::strlen(jerrno::err_msg(0x1234)), 0,
+ MAX_THROWING_SIZE - 1, MAX_THROWING_SIZE - 1);
+ throw_exception(jexception(0x1234, NULL, long_throwing_class, NULL),
+ 25 + MAX_THROWING_SIZE - 1 + ::strlen(jerrno::err_msg(0x1234)), 0,
+ MAX_THROWING_SIZE - 1, 0);
+ throw_exception(jexception(0x1234, NULL, NULL, long_throwing_fn),
+ 27 + MAX_THROWING_SIZE - 1 + ::strlen(jerrno::err_msg(0x1234)), 0, 0,
+ MAX_THROWING_SIZE - 1);
+ throw_exception(jexception(0x1234, NULL, NULL, NULL), 18 + ::strlen(jerrno::err_msg(0x1234)),
+ 0, 0, 0);
}
// Helper functions
18 years, 5 months
rhmessaging commits: r1339 - mgmt/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2007-11-20 08:58:23 -0500 (Tue, 20 Nov 2007)
New Revision: 1339
Modified:
mgmt/mint/schemaparser.py
Log:
removing db initialization code from the parser
Modified: mgmt/mint/schemaparser.py
===================================================================
--- mgmt/mint/schemaparser.py 2007-11-20 01:00:40 UTC (rev 1338)
+++ mgmt/mint/schemaparser.py 2007-11-20 13:58:23 UTC (rev 1339)
@@ -10,8 +10,6 @@
self.style = MixedCaseUnderscoreStyle()
self.pythonOutput = "from sqlobject import *\n"
self.pythonOutput += "from datetime import datetime\n"
- self.pythonOutput += "conn = connectionForURI(\"%s\")\n" % (self.options["dsn"])
- self.pythonOutput += "sqlhub.processConnection = conn\n\n"
self.additional = ""
self.currentClass = ""
self.final = "\nclassToSchemaNameMap = dict()\n"
18 years, 5 months
rhmessaging commits: r1338 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-19 20:00:40 -0500 (Mon, 19 Nov 2007)
New Revision: 1338
Modified:
mgmt/cumin/python/cumin/formats.py
Log:
Adds a function to shorten names and uses it in fmt_olink.
Modified: mgmt/cumin/python/cumin/formats.py
===================================================================
--- mgmt/cumin/python/cumin/formats.py 2007-11-19 17:13:30 UTC (rev 1337)
+++ mgmt/cumin/python/cumin/formats.py 2007-11-20 01:00:40 UTC (rev 1338)
@@ -58,11 +58,18 @@
def fmt_none():
return "<span class=\"none\">None</span>"
+def fmt_shorten(string):
+ if len(string) > 15:
+ return string[:10] + "..." + string[-5:]
+
def fmt_link(href, content, class_=""):
return "<a href=\"%s\"%s>%s</a>" % \
(href, class_ and " class=\"%s\" " % class_ or " ", content)
def fmt_olink(session, object, selected=False, name=None):
- return fmt_link(session.marshal(),
- getattr(object, "name", name),
- selected and "selected")
+ n = getattr(object, "name", name)
+
+ if isinstance(n, basestring):
+ n = fmt_shorten(n)
+
+ return fmt_link(session.marshal(), n, selected and "selected")
18 years, 5 months