rhmessaging commits: r1237 - mgmt/notes.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-05 15:18:03 -0500 (Mon, 05 Nov 2007)
New Revision: 1237
Modified:
mgmt/notes/justin-todo.txt
Log:
Promoting some todo items.
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-05 18:16:13 UTC (rev 1236)
+++ mgmt/notes/justin-todo.txt 2007-11-05 20:18:03 UTC (rev 1237)
@@ -4,10 +4,28 @@
- Find/connect in bulk
-Deferred
+ * exch, queue: make consumer, producer, and bindings columns links
+ * Add ability to send a test message to a queue
+
+ * Use page attributes for session errors, redirect
+
* Queue: Add a msg enq rate msg deq rate chart
+ * The * text-decoration: none rule is apparently expensive; find
+ another way
+
+ * Right now, non cumin pages don't print their stack traces in the
+ log
+
+ * Right now we're calling render_title outside of render in order to
+ produce tab labels, for instance. This is not good, especially in
+ cases where get_object is overriden and that fact is not reflected
+ in the render_title calls. Perhaps introduce a get_title to solve
+ this.
+
+Deferred
+
* Make the status lights also be links to an appropriate view
- Defer until we know what we're going to link to
@@ -42,23 +60,7 @@
* Broker browser: Add an ungrouped radio button
- * Right now we're calling render_title outside of render in order to
- produce tab labels, for instance. This is not good, especially in
- cases where get_object is overriden and that fact is not reflected
- in the render_title calls. Perhaps introduce a get_title to solve
- this.
-
- * Add ability to send a test message to a queue
-
- * Use page attributes for session errors, redirect
-
* Add a sanity check traversal to the widget tree and to the
registered sets of widgets and parameters
- * Right now, non cumin pages don't print their stack traces in the
- log
-
* Add a frame() accessor to Widget
-
- * The * text-decoration: none rule is apparently expensive; find
- another way
17 years, 1 month
rhmessaging commits: r1236 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-05 13:16:13 -0500 (Mon, 05 Nov 2007)
New Revision: 1236
Added:
mgmt/cumin/python/cumin/formats.py
Log:
This file was supposed to with change 1235.
Added: mgmt/cumin/python/cumin/formats.py
===================================================================
--- mgmt/cumin/python/cumin/formats.py (rev 0)
+++ mgmt/cumin/python/cumin/formats.py 2007-11-05 18:16:13 UTC (rev 1236)
@@ -0,0 +1,45 @@
+from datetime import datetime
+
+from util import *
+
+def fmt_datetime(dtime):
+ return dtime.strftime("%d %b %Y %H:%M")
+
+def fmt_rate(value, unit1, unit2):
+ #return "%i <small>%s/%s</small>" % (value, unit1, unit2)
+ return "%i<small>/%s</small>" % (value, unit2)
+
+def fmt_predicate(predicate):
+ return predicate and "Yes" or "No"
+
+def fmt_status(errors, warnings, active=True):
+ count = errors + warnings
+
+ if count == 0:
+ number = " "
+ elif count > 9:
+ number = "+"
+ else:
+ number = str(count)
+
+ if active:
+ if count == 0:
+ class_ = "green"
+ else:
+ class_ = errors and "red" or "yellow"
+ else:
+ class_ = "inactive"
+
+ return "<div class=\"statuslight %s\">%s</div>" % (class_, number)
+
+def fmt_none():
+ return "<span class=\"none\">None</span>"
+
+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):
+ return fmt_link(session.marshal(),
+ getattr(object, "name", object),
+ selected and "selected")
17 years, 1 month
rhmessaging commits: r1235 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-05 13:15:43 -0500 (Mon, 05 Nov 2007)
New Revision: 1235
Modified:
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/brokercluster.py
mgmt/cumin/python/cumin/brokergroup.py
mgmt/cumin/python/cumin/brokerprofile.py
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/measurement.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/virtualhost.py
mgmt/cumin/python/cumin/widgets.py
Log:
Refactors format functions. Adds a formats.py
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2007-11-05 17:41:37 UTC (rev 1234)
+++ mgmt/cumin/python/cumin/broker.py 2007-11-05 18:15:43 UTC (rev 1235)
@@ -1,5 +1,6 @@
from wooly import *
from wooly.widgets import *
+from random import random
from configproperty import *
from virtualhost import *
@@ -8,8 +9,8 @@
from client import *
from widgets import *
from parameters import *
+from formats import *
from util import *
-from random import random
strings = StringCatalog(__file__)
@@ -23,7 +24,7 @@
def render_item_link(self, session, broker):
branch = session.branch()
self.page().show_broker(branch, broker).show_view(branch)
- return mlink(branch.marshal(), "Broker", broker.name)
+ return fmt_olink(branch, broker)
def render_item_group_link(self, session, broker):
group = broker.get_broker_group()
@@ -31,9 +32,9 @@
if group:
branch = session.branch()
self.page().show_broker_group(branch, group).show_view(branch)
- return mlink(branch.marshal(), "BrokerGroup", group.name)
+ return fmt_olink(branch, group)
else:
- return none()
+ return fmt_none()
def render_item_profile_link(self, session, broker):
profile = broker.get_broker_profile()
@@ -41,9 +42,9 @@
if profile:
branch = session.branch()
self.page().show_broker_profile(branch, profile).show_view(branch)
- return mlink(branch.marshal(), "BrokerProfile", profile.name)
+ return fmt_olink(branch, profile)
else:
- return none()
+ return fmt_none()
def render_item_cluster_link(self, session, broker):
cluster = broker.get_broker_cluster()
@@ -51,12 +52,12 @@
if cluster:
branch = session.branch()
self.page().show_broker_cluster(branch, cluster).show_view(branch)
- return mlink(branch.marshal(), "Cluster", cluster.name)
+ return fmt_olink(branch, cluster)
else:
- return none()
+ return fmt_none()
def render_item_status(self, session, broker):
- return status(len(broker.errors), len(broker.warnings))
+ return fmt_status(len(broker.errors), len(broker.warnings))
def render_item_load(self, session, broker):
return "%.2f" % random()
@@ -259,9 +260,9 @@
if cluster:
branch = session.branch()
self.page().show_broker_cluster(branch, cluster).show_view(branch)
- return mlink(branch.marshal(), "Cluster", cluster.name)
+ return fmt_olink(branch, cluster)
else:
- return none()
+ return fmt_none()
def render_profile_link(self, session, broker):
profile = broker.get_broker_profile()
@@ -269,9 +270,9 @@
if profile:
branch = session.branch()
self.page().show_broker_profile(branch, profile).show_view(branch)
- return mlink(branch.marshal(), "BrokerProfile", profile.name)
+ return fmt_olink(branch, profile)
else:
- return none()
+ return fmt_none()
def render_version(self, session, broker):
return "1.0"
@@ -391,7 +392,7 @@
return brokers
def render_none(self, session, model):
- return none()
+ return fmt_none()
def render_clear_filters_href(self, session, model):
branch = session.branch()
@@ -440,4 +441,4 @@
class_ = param.get(session) is object and "selected"
- return link(href, name, class_)
+ return fmt_link(href, name, class_)
Modified: mgmt/cumin/python/cumin/brokercluster.py
===================================================================
--- mgmt/cumin/python/cumin/brokercluster.py 2007-11-05 17:41:37 UTC (rev 1234)
+++ mgmt/cumin/python/cumin/brokercluster.py 2007-11-05 18:15:43 UTC (rev 1235)
@@ -6,6 +6,7 @@
from broker import *
from widgets import *
from parameters import *
+from formats import *
from util import *
strings = StringCatalog(__file__)
@@ -25,7 +26,7 @@
def render_item_link(self, session, cluster):
branch = session.branch()
self.page().show_broker_cluster(branch, cluster).show_view(branch)
- return mlink(branch.marshal(), "BrokerCluster", cluster.name)
+ return fmt_olink(branch, cluster)
def render_item_config(self, session, cluster):
count = len(cluster.broker_items())
@@ -35,7 +36,7 @@
writer = Writer()
for broker in sorted_by(cluster.broker_items()):
- writer.write(status(len(broker.errors), len(broker.warnings)))
+ writer.write(fmt_status(len(broker.errors), len(broker.warnings)))
return writer.to_string()
Modified: mgmt/cumin/python/cumin/brokergroup.py
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.py 2007-11-05 17:41:37 UTC (rev 1234)
+++ mgmt/cumin/python/cumin/brokergroup.py 2007-11-05 18:15:43 UTC (rev 1235)
@@ -5,6 +5,7 @@
from model import *
from widgets import *
from parameters import *
+from formats import *
from util import *
strings = StringCatalog(__file__)
@@ -24,7 +25,7 @@
def render_item_link(self, session, group):
branch = session.branch()
self.page().show_broker_group(branch, group).show_view(branch)
- return mlink(branch.marshal(), "BrokerGroup", group.name)
+ return fmt_olink(branch, group)
def render_item_config(self, session, group):
count = len(group.broker_items())
@@ -34,12 +35,12 @@
writer = Writer()
for broker in sorted_by(group.broker_items()):
- writer.write(status(len(broker.errors), len(broker.warnings)))
+ writer.write(fmt_status(len(broker.errors), len(broker.warnings)))
return writer.to_string()
def render_none(self, session, group):
- return none()
+ return fmt_none()
class BrokerGroupFrame(CuminFrame):
def __init__(self, app, name):
Modified: mgmt/cumin/python/cumin/brokerprofile.py
===================================================================
--- mgmt/cumin/python/cumin/brokerprofile.py 2007-11-05 17:41:37 UTC (rev 1234)
+++ mgmt/cumin/python/cumin/brokerprofile.py 2007-11-05 18:15:43 UTC (rev 1235)
@@ -16,7 +16,7 @@
def render_item_link(self, session, profile):
branch = session.branch()
self.page().show_broker_profile(branch, profile).show_view(branch)
- return mlink(branch.marshal(), "BrokerProfile", profile.name)
+ return fmt_olink(branch, profile)
class BrokerProfileFrame(CuminFrame):
def __init__(self, app, name):
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-11-05 17:41:37 UTC (rev 1234)
+++ mgmt/cumin/python/cumin/client.py 2007-11-05 18:15:43 UTC (rev 1235)
@@ -4,6 +4,7 @@
from measurement import *
from widgets import *
from parameters import *
+from formats import *
from util import *
strings = StringCatalog(__file__)
@@ -18,10 +19,10 @@
def render_item_link(self, session, client):
branch = session.branch()
self.page().show_client(branch, client).show_view(branch)
- return mlink(branch.marshal(), "Client", client.address)
+ return fmt_olink(branch, client.address)
def render_item_status(self, session, client):
- return status(len(client.errors), len(client.warnings))
+ return fmt_status(len(client.errors), len(client.warnings))
def render_item_messages_produced(self, session, client):
return client.get_measurement("msgsProduced").get_value()
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-11-05 17:41:37 UTC (rev 1234)
+++ mgmt/cumin/python/cumin/exchange.py 2007-11-05 18:15:43 UTC (rev 1235)
@@ -7,6 +7,7 @@
from model import *
from widgets import *
from parameters import *
+from formats import *
from util import *
strings = StringCatalog(__file__)
@@ -50,7 +51,7 @@
def render_item_link(self, session, exchange):
branch = session.branch()
self.page().show_exchange(branch, exchange).show_view(branch)
- return mlink(branch.marshal(), "Exchange", exchange.name)
+ return fmt_olink(branch, exchange)
def render_item_producers(self, session, exchange):
return len(exchange.producer_items())
@@ -74,7 +75,7 @@
return exchange.get_measurement(key).get_value()
def render_item_status(self, session, exchange):
- return status(len(exchange.errors), len(exchange.warnings))
+ return fmt_status(len(exchange.errors), len(exchange.warnings))
def show_producers(page, session, exchange):
frame = page.show_exchange(session, exchange).show_view(session)
Modified: mgmt/cumin/python/cumin/measurement.py
===================================================================
--- mgmt/cumin/python/cumin/measurement.py 2007-11-05 17:41:37 UTC (rev 1234)
+++ mgmt/cumin/python/cumin/measurement.py 2007-11-05 18:15:43 UTC (rev 1235)
@@ -4,6 +4,7 @@
from widgets import *
from parameters import *
from util import *
+from formats import *
strings = StringCatalog(__file__)
@@ -38,7 +39,7 @@
if measure.link_cb:
branch = session.branch()
measure.link_cb(self.page(), branch, self.object.get(session))
- return link(branch.marshal(), measure.get_value())
+ return fmt_link(branch.marshal(), measure.get_value())
else:
return measure.get_value()
@@ -48,7 +49,7 @@
% (measure.get_high() or 0, measure.get_low() or 0)
else:
unit = self.unit_abbrevs.get(measure.unit, measure.unit)
- return rate(measure.get_rate(), unit, "sec")
+ return fmt_rate(measure.get_rate(), unit, "sec")
def render_item_average(self, session, measure):
return "%0.2f" % (sum(measure.values) / float(len(measure.values)))
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-05 17:41:37 UTC (rev 1234)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-05 18:15:43 UTC (rev 1235)
@@ -8,6 +8,7 @@
from measurement import *
from widgets import *
from parameters import *
+from formats import *
from util import *
strings = StringCatalog(__file__)
@@ -34,7 +35,7 @@
def render_item_link(self, session, queue):
branch = session.branch()
self.page().show_queue(branch, queue).show_view(branch)
- return mlink(branch.marshal(), "Queue", queue.name)
+ return fmt_olink(branch, queue)
def render_item_name(self, session, queue):
return queue.name
@@ -49,13 +50,13 @@
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")
+ return fmt_rate(value, unit == "b" and "byte" or "msg", "sec")
def render_item_dequeued(self, session, queue):
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")
+ return fmt_rate(value, unit == "b" and "byte" or "msg", "sec")
def render_item_depth(self, session, queue):
key = self.unit.get(session) == "b" and "byteDepth" or "msgDepth"
@@ -65,10 +66,10 @@
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")
+ return fmt_rate(value, unit == "b" and "byte" or "msg", "sec")
def render_item_status(self, session, queue):
- return status(len(queue.errors), len(queue.warnings))
+ return fmt_status(len(queue.errors), len(queue.warnings))
def show_consumers(page, session, queue):
frame = page.show_queue(session, queue).show_view(session)
@@ -109,33 +110,33 @@
def render_message_enqueues(self, session, queue):
value = queue.get_measurement("msgTotalEnqueues").get_rate()
- return rate(value, "msg", "sec")
+ return fmt_rate(value, "msg", "sec")
def render_message_dequeues(self, session, queue):
value = queue.get_measurement("msgTotalDequeues").get_rate()
- return rate(value, "msg", "sec")
+ return fmt_rate(value, "msg", "sec")
def render_message_depth(self, session, queue):
return queue.get_measurement("msgDepth").get_value()
def render_message_depth_accel(self, session, queue):
value = queue.get_measurement("msgDepth").get_rate()
- return rate(value, "msg", "sec")
+ return fmt_rate(value, "msg", "sec")
def render_byte_enqueues(self, session, queue):
value = queue.get_measurement("byteTotalEnqueues").get_rate()
- return rate(value, "byte", "sec")
+ return fmt_rate(value, "byte", "sec")
def render_byte_dequeues(self, session, queue):
value = queue.get_measurement("byteTotalDequeues").get_rate()
- return rate(value, "byte", "sec")
+ return fmt_rate(value, "byte", "sec")
def render_byte_depth(self, session, queue):
return queue.get_measurement("byteDepth").get_value()
def render_byte_depth_accel(self, session, queue):
value = queue.get_measurement("byteDepth").get_rate()
- return rate(value, "byte", "sec")
+ return fmt_rate(value, "byte", "sec")
class QueueView(Widget):
def __init__(self, app, name):
@@ -168,10 +169,10 @@
return queue.name
def render_durable(self, session, queue):
- return yes_no(queue.is_durable)
+ return fmt_predicate(queue.is_durable)
def render_exclusive(self, session, queue):
- return yes_no(queue.is_exclusive)
+ return fmt_predicate(queue.is_exclusive)
def render_created_deleted(self, session, queue):
return "%s - %s" % (fmt_datetime(datetime.utcnow()), "")
Modified: mgmt/cumin/python/cumin/virtualhost.py
===================================================================
--- mgmt/cumin/python/cumin/virtualhost.py 2007-11-05 17:41:37 UTC (rev 1234)
+++ mgmt/cumin/python/cumin/virtualhost.py 2007-11-05 18:15:43 UTC (rev 1235)
@@ -6,6 +6,7 @@
from client import *
from widgets import *
from parameters import *
+from formats import *
from util import *
strings = StringCatalog(__file__)
@@ -20,7 +21,7 @@
def render_item_link(self, session, vhost):
branch = session.branch()
self.page().show_virtual_host(branch, vhost).show_view(branch)
- return mlink(branch.marshal(), "VirtualHost", vhost.name)
+ return fmt_olink(branch, vhost)
class VirtualHostFrame(CuminFrame):
def __init__(self, app, name):
@@ -81,9 +82,9 @@
if broker:
branch = session.branch()
self.page().show_broker(branch, broker).show_view(branch)
- return mlink(branch.marshal(), "Broker", broker.name)
+ return fmt_olink(branch, broker)
else:
- return none()
+ return fmt_none()
def render_cluster_link(self, session, vhost):
cluster = vhost.get_broker_cluster()
@@ -91,6 +92,6 @@
if cluster:
branch = session.branch()
self.page().show_broker_cluster(branch, cluster).show_view(branch)
- return mlink(branch.marshal(), "Cluster", cluster.name)
+ return fmt_olink(branch, cluster)
else:
- return none()
+ return fmt_none()
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2007-11-05 17:41:37 UTC (rev 1234)
+++ mgmt/cumin/python/cumin/widgets.py 2007-11-05 18:15:43 UTC (rev 1235)
@@ -1,53 +1,13 @@
from wooly import *
from wooly.widgets import *
from wooly.forms import *
-from datetime import datetime
-from util import *
from charts import *
+from formats import *
+from util import *
strings = StringCatalog(__file__)
-def link(href, content, class_=""):
- return "<a%shref=\"%s\">%s</a>" % \
- (class_ and " class=\"%s\" " % class_ or " ", href, content)
-
-def mlink(href, variety, name, selected=False):
- return link(href, name, selected and "selected")
-
-def none():
- return "<span class=\"none\">None</span>"
-
-def status(errors, warnings, active=True):
- count = errors + warnings
-
- if count == 0:
- number = " "
- elif count > 9:
- number = "+"
- else:
- number = str(count)
-
- if active:
- if count == 0:
- class_ = "green"
- else:
- class_ = errors and "red" or "yellow"
- else:
- class_ = "inactive"
-
- return "<div class=\"statuslight %s\">%s</div>" % (class_, number)
-
-def yes_no(predicate):
- return predicate and "Yes" or "No"
-
-def rate(value, unit1, unit2):
- #return "%i <small>%s/%s</small>" % (value, unit1, unit2)
- return "%i<small>/%s</small>" % (value, unit2)
-
-def fmt_datetime(dtime):
- return dtime.strftime("%d %b %Y %H:%M")
-
class CuminFrame(Frame, ModeSet):
def __init__(self, app, name):
super(CuminFrame, self).__init__(app, name)
@@ -232,7 +192,7 @@
class_ = self.get(session) == "m" and "selected"
- return link(branch.marshal(), "Messages", class_)
+ return fmt_link(branch.marshal(), "Messages", class_)
def render_bytes_link(self, session, vhost):
branch = session.branch()
@@ -240,4 +200,4 @@
class_ = self.get(session) == "b" and "selected"
- return link(branch.marshal(), "Bytes", class_)
+ return fmt_link(branch.marshal(), "Bytes", class_)
17 years, 1 month
rhmessaging commits: r1234 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-05 12:41:37 -0500 (Mon, 05 Nov 2007)
New Revision: 1234
Modified:
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/page.strings
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/python/cumin/widgets.py
mgmt/notes/justin-todo.txt
Log:
Adds timestamps for creation, deletion, and updates to q,e,c.
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-11-05 16:56:24 UTC (rev 1233)
+++ mgmt/cumin/python/cumin/client.py 2007-11-05 17:41:37 UTC (rev 1234)
@@ -75,6 +75,12 @@
def render_auth_id(self, session, client):
return "e50e7dcaa8d6a039a"
+ def render_created_deleted(self, session, queue):
+ return "%s - %s" % (fmt_datetime(datetime.utcnow()), "")
+
+ def render_updated(self, session, queue):
+ return fmt_datetime(datetime.utcnow())
+
class ClientStatistics(TabSet):
def __init__(self, app, name):
super(ClientStatistics, self).__init__(app, name)
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-11-05 16:56:24 UTC (rev 1233)
+++ mgmt/cumin/python/cumin/client.strings 2007-11-05 17:41:37 UTC (rev 1234)
@@ -40,6 +40,8 @@
<table class="props">
<tr><th>Address</th><td>{address}</td></tr>
<tr><th>Auth. ID</th><td>{auth_id}</td></tr>
+ <tr><th>Created - Deleted</th><td>{created_deleted}</td></tr>
+ <tr><th>Updated</th><td>{updated}</td></tr>
<tr>
<th class="actions" colspan="2">
<h2>Act on This Client:</h2>
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-11-05 16:56:24 UTC (rev 1233)
+++ mgmt/cumin/python/cumin/exchange.py 2007-11-05 17:41:37 UTC (rev 1234)
@@ -136,7 +136,7 @@
def render_title(self, session, exchange):
return "Exchange '%s'" % exchange.name
- def render_exchange_name(self, session, exchange):
+ def render_name(self, session, exchange):
return exchange.name
def render_type(self, session, exchange):
@@ -149,6 +149,12 @@
else:
raise Exception()
+ def render_created_deleted(self, session, queue):
+ return "%s - %s" % (fmt_datetime(datetime.utcnow()), "")
+
+ def render_updated(self, session, queue):
+ return fmt_datetime(datetime.utcnow())
+
class ExchangeBindingSet(ItemSet):
def render_title(self, session, exchange):
return "Queue Bindings (%i)" % len(exchange.binding_items())
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2007-11-05 16:56:24 UTC (rev 1233)
+++ mgmt/cumin/python/cumin/exchange.strings 2007-11-05 17:41:37 UTC (rev 1234)
@@ -88,10 +88,12 @@
<h1><img src="resource?name=exchange-36.png"> {title}</h1>
-<dl class="properties">
- <dt>Name</dt><dd>{exchange_name}</dd>
- <dt>Type</dt><dd>{type}</dd>
-</dl>
+<table class="props">
+ <tr><th>Name</th><td>{name}</td></tr>
+ <tr><th>Type</th><td>{type}</td></tr>
+ <tr><th>Created - Deleted</th><td>{created_deleted}</td></tr>
+ <tr><th>Updated</th><td>{updated}</td></tr>
+</table>
{tabs}
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-11-05 16:56:24 UTC (rev 1233)
+++ mgmt/cumin/python/cumin/page.strings 2007-11-05 17:41:37 UTC (rev 1234)
@@ -175,7 +175,7 @@
table.props {
margin: 0 0 1.5em 0;
- width: 25em;
+ width: 30em;
border-collapse: collapse;
}
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-05 16:56:24 UTC (rev 1233)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-05 17:41:37 UTC (rev 1234)
@@ -2,6 +2,7 @@
from wooly.widgets import *
from wooly.forms import *
from wooly.resources import *
+from datetime import datetime
from exchange import ExchangeInputSet
from measurement import *
@@ -172,6 +173,12 @@
def render_exclusive(self, session, queue):
return yes_no(queue.is_exclusive)
+ def render_created_deleted(self, session, queue):
+ return "%s - %s" % (fmt_datetime(datetime.utcnow()), "")
+
+ def render_updated(self, session, queue):
+ return fmt_datetime(datetime.utcnow())
+
class QueueBindingSet(ItemSet):
def render_title(self, session, queue):
return "Exchange Bindings (%i)" % len(queue.binding_items())
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-05 16:56:24 UTC (rev 1233)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-05 17:41:37 UTC (rev 1234)
@@ -160,6 +160,8 @@
<tr><th>Name</th><td>{name}</td></tr>
<tr><th>Durable?</th><td>{durable}</td></tr>
<tr><th>Exclusive?</th><td>{exclusive}</td></tr>
+ <tr><th>Created - Deleted</th><td>{created_deleted}</td></tr>
+ <tr><th>Updated</th><td>{updated}</td></tr>
<tr>
<th class="actions" colspan="2">
<h2>Act on This Queue:</h2>
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2007-11-05 16:56:24 UTC (rev 1233)
+++ mgmt/cumin/python/cumin/widgets.py 2007-11-05 17:41:37 UTC (rev 1234)
@@ -1,6 +1,7 @@
from wooly import *
from wooly.widgets import *
from wooly.forms import *
+from datetime import datetime
from util import *
from charts import *
@@ -44,6 +45,9 @@
#return "%i <small>%s/%s</small>" % (value, unit1, unit2)
return "%i<small>/%s</small>" % (value, unit2)
+def fmt_datetime(dtime):
+ return dtime.strftime("%d %b %Y %H:%M")
+
class CuminFrame(Frame, ModeSet):
def __init__(self, app, name):
super(CuminFrame, self).__init__(app, name)
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-05 16:56:24 UTC (rev 1233)
+++ mgmt/notes/justin-todo.txt 2007-11-05 17:41:37 UTC (rev 1234)
@@ -4,10 +4,6 @@
- Find/connect in bulk
- * Queue: Add created, deleted, updated timestamps
-
- * Fix the broken charts
-
Deferred
* Queue: Add a msg enq rate msg deq rate chart
17 years, 1 month
rhmessaging commits: r1233 - in mgmt: cumin/python/wooly and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-05 11:56:24 -0500 (Mon, 05 Nov 2007)
New Revision: 1233
Modified:
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/wooly/__init__.py
mgmt/notes/justin-todo.txt
Log:
Fixes a bug to do with parameter resolution across pages. The bug
showed up when I added exchange forms.
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-05 15:49:48 UTC (rev 1232)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-05 16:56:24 UTC (rev 1233)
@@ -471,6 +471,6 @@
def __init__(self, app, name):
super(QueueChartPage, self).__init__(app, name)
- self.param = QueueParameter(app, "id")
- self.add_parameter(self.param)
- self.set_object_parameter(self.param)
+ self.queue = QueueParameter(app, "id")
+ self.add_parameter(self.queue)
+ self.set_object_parameter(self.queue)
Modified: mgmt/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/cumin/python/wooly/__init__.py 2007-11-05 15:49:48 UTC (rev 1232)
+++ mgmt/cumin/python/wooly/__init__.py 2007-11-05 16:56:24 UTC (rev 1233)
@@ -370,16 +370,16 @@
self.parameters.append(param)
- def get_parameter(self, key):
+ def get_parameter(self, page, key):
if not self.parameter_index:
index = dict()
for param in self.parameters:
- index[param.path()] = param
+ index[(param.widget.page(), param.path())] = param
self.parameter_index = index
- return self.parameter_index.get(key)
+ return self.parameter_index.get((page, key))
def add_resource_dir(self, dir):
self.finder.add_dir(dir)
@@ -572,7 +572,7 @@
key, svalue = var.split("=")
value = unquote_plus(svalue)
- param = self.app.get_parameter(key)
+ param = self.app.get_parameter(self.get_page(), key)
if param:
param.add(self, param.unmarshal(value))
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-05 15:49:48 UTC (rev 1232)
+++ mgmt/notes/justin-todo.txt 2007-11-05 16:56:24 UTC (rev 1233)
@@ -6,6 +6,8 @@
* Queue: Add created, deleted, updated timestamps
+ * Fix the broken charts
+
Deferred
* Queue: Add a msg enq rate msg deq rate chart
17 years, 1 month
rhmessaging commits: r1232 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-05 10:49:48 -0500 (Mon, 05 Nov 2007)
New Revision: 1232
Modified:
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/measurement.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.py
mgmt/notes/justin-todo.txt
Log:
Makes some values in the stats view link to relevant tabs.
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-11-05 13:38:46 UTC (rev 1231)
+++ mgmt/cumin/python/cumin/exchange.py 2007-11-05 15:49:48 UTC (rev 1232)
@@ -76,6 +76,14 @@
def render_item_status(self, session, exchange):
return status(len(exchange.errors), len(exchange.warnings))
+def show_producers(page, session, exchange):
+ frame = page.show_exchange(session, exchange).show_view(session)
+ return frame.show_producers(session)
+
+def show_bindings(page, session, exchange):
+ frame = page.show_exchange(session, exchange).show_view(session)
+ return frame.show_bindings(session)
+
class ExchangeFrame(CuminFrame):
def __init__(self, app, name):
super(ExchangeFrame, self).__init__(app, name)
@@ -88,6 +96,13 @@
self.add_mode(self.view)
self.set_view_mode(self.view)
+ # XXX not awesome
+ def get_object(self, session, object):
+ exchange = self.param.get(session)
+ exchange.get_measurement("producers").link_cb = show_producers
+ exchange.get_measurement("bindings").link_cb = show_bindings
+ return exchange
+
def render_title(self, session, exchange):
return "Exchange '%s'" % exchange.name
@@ -105,9 +120,19 @@
self.add_child(self.tabs)
self.tabs.add_tab(ExchangeStatistics(app, "stats"))
- self.tabs.add_tab(ExchangeProducerSet(app, "producers"))
- self.tabs.add_tab(ExchangeBindingSet(app, "bindings"))
+ self.producers = ExchangeProducerSet(app, "producers")
+ self.tabs.add_tab(self.producers)
+
+ self.bindings = ExchangeBindingSet(app, "bindings")
+ self.tabs.add_tab(self.bindings)
+
+ def show_producers(self, session):
+ self.tabs.show_mode(session, self.producers);
+
+ def show_bindings(self, session):
+ self.tabs.show_mode(session, self.bindings);
+
def render_title(self, session, exchange):
return "Exchange '%s'" % exchange.name
Modified: mgmt/cumin/python/cumin/measurement.py
===================================================================
--- mgmt/cumin/python/cumin/measurement.py 2007-11-05 13:38:46 UTC (rev 1231)
+++ mgmt/cumin/python/cumin/measurement.py 2007-11-05 15:49:48 UTC (rev 1232)
@@ -17,10 +17,15 @@
self.category = category
- def get_items(self, session, queue):
- measures = list(queue.measurements)
+ self.object = Attribute(app, "object");
+ self.add_attribute(self.object);
- for measure in queue.measurements:
+ def get_items(self, session, object):
+ self.object.set(session, object);
+
+ measures = list(object.measurements)
+
+ for measure in object.measurements:
if self.category not in measure.categories:
measures.remove(measure)
@@ -30,7 +35,12 @@
return measure.title
def render_item_value(self, session, measure):
- return measure.get_value()
+ if measure.link_cb:
+ branch = session.branch()
+ measure.link_cb(self.page(), branch, self.object.get(session))
+ return link(branch.marshal(), measure.get_value())
+ else:
+ return measure.get_value()
def render_item_extra(self, session, measure):
if measure.highlow:
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-05 13:38:46 UTC (rev 1231)
+++ mgmt/cumin/python/cumin/model.py 2007-11-05 15:49:48 UTC (rev 1232)
@@ -327,6 +327,7 @@
self.__value = None
self.__values = list()
self.class_ = class_
+ self.link_cb = None
self.highlow = False
self.__high = None
@@ -435,6 +436,12 @@
measure.categories = ("byte", "general")
self.measurements.append(measure)
+ measure = Measurement("unackedMessages", "int")
+ measure.title = "Msgs. Unacked"
+ measure.unit = "message"
+ measure.categories = ("general")
+ self.measurements.append(measure)
+
measure = Measurement("consumers", "int")
measure.title = "Consumers"
measure.unit = "consumer"
@@ -442,10 +449,11 @@
measure.highlow = True
self.measurements.append(measure)
- measure = Measurement("unackedMessages", "int")
- measure.title = "Msgs. Unacked"
- measure.unit = "message"
+ measure = Measurement("bindings", "int")
+ measure.title = "Bindings"
+ measure.unit = "binding"
measure.categories = ("general")
+ measure.highlow = True
self.measurements.append(measure)
# Disk
@@ -633,13 +641,6 @@
self.errors = list()
self.warnings = list()
- 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"
@@ -676,6 +677,20 @@
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()
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-05 13:38:46 UTC (rev 1231)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-05 15:49:48 UTC (rev 1232)
@@ -69,6 +69,14 @@
def render_item_status(self, session, queue):
return status(len(queue.errors), len(queue.warnings))
+def show_consumers(page, session, queue):
+ frame = page.show_queue(session, queue).show_view(session)
+ return frame.show_consumers(session)
+
+def show_bindings(page, session, queue):
+ frame = page.show_queue(session, queue).show_view(session)
+ return frame.show_bindings(session)
+
class QueueFrame(CuminFrame):
def __init__(self, app, name):
super(QueueFrame, self).__init__(app, name)
@@ -81,6 +89,13 @@
self.add_mode(self.view)
self.set_view_mode(self.view)
+ # XXX not awesome
+ def get_object(self, session, object):
+ queue = self.param.get(session)
+ queue.get_measurement("consumers").link_cb = show_consumers
+ queue.get_measurement("bindings").link_cb = show_bindings
+ return queue
+
def render_title(self, session, queue):
return "Queue '%s'" % queue.name
@@ -132,9 +147,19 @@
self.add_child(self.tabs)
self.tabs.add_tab(QueueStatistics(app, "stats"))
- self.tabs.add_tab(QueueConsumerSet(app, "consumers"))
- self.tabs.add_tab(QueueBindingSet(app, "bindings"))
+ self.consumers = QueueConsumerSet(app, "consumers")
+ self.tabs.add_tab(self.consumers)
+
+ self.bindings = QueueBindingSet(app, "bindings")
+ self.tabs.add_tab(self.bindings)
+
+ def show_consumers(self, session):
+ self.tabs.show_mode(session, self.consumers);
+
+ def show_bindings(self, session):
+ self.tabs.show_mode(session, self.bindings);
+
def render_title(self, session, queue):
return "Queue '%s'" % queue.name
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-05 13:38:46 UTC (rev 1231)
+++ mgmt/notes/justin-todo.txt 2007-11-05 15:49:48 UTC (rev 1232)
@@ -4,16 +4,10 @@
- Find/connect in bulk
- * queue: link bindings, consumers stat to respective views
+ * Queue: Add created, deleted, updated timestamps
- * exch: link bindings, producers stats to respective views
-
- * Make queue status ajaxy again
-
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
17 years, 1 month
rhmessaging commits: r1231 - mgmt/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-05 08:38:46 -0500 (Mon, 05 Nov 2007)
New Revision: 1231
Modified:
mgmt/cumin/python/wooly/__init__.py
Log:
A trivial change just for clarity.
Modified: mgmt/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/cumin/python/wooly/__init__.py 2007-11-03 01:03:10 UTC (rev 1230)
+++ mgmt/cumin/python/wooly/__init__.py 2007-11-05 13:38:46 UTC (rev 1231)
@@ -697,17 +697,13 @@
elif callable(elem):
result = elem(self.widget, session, object)
- if result is None:
- result = ""
-
- writer.write(str(result))
+ if result is not None:
+ writer.write(str(result))
else:
result = elem.render(session, object)
- if result is None:
- result = ""
-
- writer.write(str(result))
+ if result is not None:
+ writer.write(str(result))
class WidgetCall(object):
def __init__(self, stack, widget, session, object):
17 years, 1 month
rhmessaging commits: r1230 - in store/trunk/cpp: tests and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: cctrieloff
Date: 2007-11-02 21:03:10 -0400 (Fri, 02 Nov 2007)
New Revision: 1230
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/BdbMessageStore.h
store/trunk/cpp/tests/OrderingTest.cpp
store/trunk/cpp/tests/SimpleTest.cpp
store/trunk/cpp/tests/TransactionalTest.cpp
store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
store/trunk/cpp/tests/system_test.sh
Log:
- check for db mode change
- support for force
- store last mode in config db - key 1
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2007-11-02 22:16:50 UTC (rev 1229)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2007-11-03 01:03:10 UTC (rev 1230)
@@ -51,6 +51,7 @@
BdbMessageStore::BdbMessageStore(const char* envpath) : env(0),
queueDb(&env, 0),
+ configDb(&env, 0),
exchangeDb(&env, 0),
messageDb(&env, 0),
mappingDb(&env, 0),
@@ -66,19 +67,23 @@
}
-void BdbMessageStore::init(const std::string& dir, const bool async)
+bool BdbMessageStore::init(const std::string& dir, const bool async, const bool force)
{
+ if (isInit) return true;
+
useAsync = async;
if (dir.size()>0) storeDir = dir;
string bdbdir = storeDir + "/rhm/dat/";
journal::jdir::create_dir(bdbdir);
TxnCtxt txn;
+ bool ret = false;
try {
env.open(bdbdir.c_str(), DB_THREAD | DB_CREATE | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_USE_ENVIRON, 0);
txn.begin(env);
open(queueDb, txn.get(), "queues.db", false);
+ open(configDb, txn.get(), "config.db", false);
open(exchangeDb, txn.get(), "exchanges.db", false);
open(messageDb, txn.get(), "messages.db", false);
open(mappingDb, txn.get(), "mappings.db", true);
@@ -94,10 +99,61 @@
txn.abort();
throw e;
}
+ ret = mode(async, force);
+ if (!ret) return false;
isInit = true;
+ return true;
}
+// true is async
+bool BdbMessageStore::mode(const bool async, const bool force)
+{
+
+ u_int32_t id (1); // key one in config is mode
+ Dbt key(&id, sizeof(id));
+ size_t preamble_length = sizeof(u_int32_t);
+ BufferValue value(preamble_length, 0);
+ u_int32_t avalue = async ? 1 : 2;
+ value.buffer.putLong( avalue );
+ bool same = false;
+ bool hasMode = false;
+
+ {
+ Cursor config;
+ config.open(configDb, 0);
+ IdDbt rkey;
+ BufferValue rvalue(preamble_length, 0);
+ rvalue.buffer.record();
+
+ while (config.next(rkey, rvalue)) {
+ if (rkey.id == 1)
+ {
+ hasMode = true;
+ u_int32_t valueL = rvalue.buffer.getLong();
+ if (avalue == valueL){
+ same = true;
+ }else {
+ break;
+ }
+ }
+ }
+ }
+ if (same) return true;
+ if (!same && !force && hasMode) return false;
+ if (!same && force && hasMode) {
+ truncate();
+ }
+
+ int status = configDb.put(0, &key, &value, DB_NOOVERWRITE | DB_AUTO_COMMIT );
+ if (status == DB_KEYEXIST) {
+ return false;
+ } else {
+ return true;
+ }
+ return false;
+}
+
void BdbMessageStore::open(Db& db, DbTxn* txn, const char* file, bool dupKey)
{
if(dupKey) db.set_flags(DB_DUPSORT);
@@ -121,7 +177,6 @@
void BdbMessageStore::truncate()
{
- checkInit();
DbTxn* txn;
env.txn_begin(0, &txn, 0);
u_int32_t count;
@@ -131,15 +186,13 @@
}
txn->commit(0);
- if (usingJrnl()) {
- try{
- journal::jdir::delete_dir(getJrnlBaseDir(),true);
- }
- catch ( journal::jexception& e) {
- std::string str;
- THROW_STORE_EXCEPTION("Truncate clean up failed: " +e.to_string(str) );
- }
- }
+ try{
+ journal::jdir::delete_dir(getJrnlBaseDir(),true);
+ }
+ catch ( journal::jexception& e) {
+ std::string str;
+ THROW_STORE_EXCEPTION("Truncate clean up failed: " +e.to_string(str) );
+ }
}
void BdbMessageStore::create(PersistableQueue& queue)
@@ -337,7 +390,6 @@
recoverMessages(txn, registry, queue, prepared, messages);
jQueue->recover_complete(); // start journal.
} catch (const journal::jexception& e) {
-std::cout << e << std::flush;
std::string s;
THROW_STORE_EXCEPTION(e.to_string(s) + queueName);
}
Modified: store/trunk/cpp/lib/BdbMessageStore.h
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.h 2007-11-02 22:16:50 UTC (rev 1229)
+++ store/trunk/cpp/lib/BdbMessageStore.h 2007-11-03 01:03:10 UTC (rev 1230)
@@ -62,6 +62,7 @@
std::list<Db*> dbs;
DbEnv env;
Db queueDb;
+ Db configDb;
Db exchangeDb;
Db messageDb;
Db mappingDb;
@@ -78,6 +79,7 @@
const char* envPath;
static qpid::sys::Duration defJournalTimeout;
+ bool mode(const bool mode, const bool force);
void recoverQueues(TxnCtxt& txn, qpid::broker::RecoveryManager& recovery, queue_index& index,
txn_list& locked, message_index& messages);
void recoverMessages(TxnCtxt& txn, qpid::broker::RecoveryManager& recovery, queue_index& index,
@@ -121,11 +123,11 @@
string getJrnlDir(const char* queueName);
static inline bool usingJrnl() {return useAsync;}
string getJrnlBaseDir();
- inline void checkInit() { if (!isInit) init("/var",false); isInit = true;}
+ inline void checkInit() { if (!isInit) init("/var",false, false); isInit = true;}
public:
BdbMessageStore(const char* envpath = 0);
- void init(const std::string& dir, const bool async);
+ bool init(const std::string& dir, const bool async, const bool force = false);
~BdbMessageStore();
void truncate();
Modified: store/trunk/cpp/tests/OrderingTest.cpp
===================================================================
--- store/trunk/cpp/tests/OrderingTest.cpp 2007-11-02 22:16:50 UTC (rev 1229)
+++ store/trunk/cpp/tests/OrderingTest.cpp 2007-11-03 01:03:10 UTC (rev 1230)
@@ -104,7 +104,7 @@
void setup(bool async)
{
store = std::auto_ptr<BdbMessageStore>(new BdbMessageStore());
- store->init("/var",async);
+ store->init("/var",async,true);
store->truncate();
queue = Queue::shared_ptr(new Queue(name, 0, store.get(), 0));
Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp 2007-11-02 22:16:50 UTC (rev 1229)
+++ store/trunk/cpp/tests/SimpleTest.cpp 2007-11-03 01:03:10 UTC (rev 1230)
@@ -126,7 +126,7 @@
void testCreateDelete(bool async)
{
BdbMessageStore store;
- store.init("/var",async);
+ store.init("/var",async, true);
store.truncate();//make sure it is empty to begin with
string name("CreateDeleteQueue");
Queue queue(name, 0, &store, 0);
Modified: store/trunk/cpp/tests/TransactionalTest.cpp
===================================================================
--- store/trunk/cpp/tests/TransactionalTest.cpp 2007-11-02 22:16:50 UTC (rev 1229)
+++ store/trunk/cpp/tests/TransactionalTest.cpp 2007-11-03 01:03:10 UTC (rev 1230)
@@ -95,7 +95,7 @@
void setup(bool async)
{
store = std::auto_ptr<BdbMessageStore>(new BdbMessageStore());
- store->init("/var",async);
+ store->init("/var",async, true);
store->truncate();
//create two queues:
Modified: store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
===================================================================
--- store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2007-11-02 22:16:50 UTC (rev 1229)
+++ store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2007-11-03 01:03:10 UTC (rev 1230)
@@ -336,7 +336,7 @@
void setup()
{
store = std::auto_ptr<BdbMessageStore>(new BdbMessageStore());
- store->init("/var",async);
+ store->init("/var",async,true);
store->truncate();
//create two queues:
Modified: store/trunk/cpp/tests/system_test.sh
===================================================================
--- store/trunk/cpp/tests/system_test.sh 2007-11-02 22:16:50 UTC (rev 1229)
+++ store/trunk/cpp/tests/system_test.sh 2007-11-03 01:03:10 UTC (rev 1230)
@@ -63,13 +63,12 @@
JRNLFLAGS=''
while ((sync <= 1)); do
echo
- echo '*** FIXME: Journal cannot be started when previous mode was BDB and database exists.'
- rm -rf $WORKING_DIR/*
if ((sync == 1)); then
- JRNLFLAGS='--store-async yes'
+ JRNLFLAGS='--store-async yes --store-force yes'
mode='jrnl'
echo 'Journal (AIO) persistence...'
else
+ JRNLFLAGS='--store-force yes'
mode='bdb'
echo 'BDB persistence...'
fi
17 years, 1 month
rhmessaging commits: r1229 - in mgmt/cumin: python/wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-02 18:16:50 -0400 (Fri, 02 Nov 2007)
New Revision: 1229
Modified:
mgmt/cumin/bin/cumin-test
mgmt/cumin/python/wooly/__init__.py
Log:
Some small improvements to marshal_url_vars (one of the usual
suspects) from profiling.
Modified: mgmt/cumin/bin/cumin-test
===================================================================
--- mgmt/cumin/bin/cumin-test 2007-11-02 21:51:36 UTC (rev 1228)
+++ mgmt/cumin/bin/cumin-test 2007-11-02 22:16:50 UTC (rev 1229)
@@ -75,10 +75,10 @@
stats.sort_stats("cumulative").print_stats(15)
stats.sort_stats("time").print_stats(15)
- #stats.print_callees("wooly/__init__.*\\(marshal_url_vars\\)")
- #stats.print_callees("wooly/__init__.*\\(path\\)")
- #stats.print_callees("wooly/__init__.*\\(get\\)")
- #stats.print_callees("wooly/__init__.*\\(render\\)")
+ stats.print_callees("wooly/__init__.*\\(marshal_url_vars\\)")
+ stats.print_callees("wooly/__init__.*\\(path\\)")
+ stats.print_callees("wooly/__init__.*\\(get\\)")
+ stats.print_callees("wooly/__init__.*\\(render\\)")
stats.strip_dirs()
else:
Modified: mgmt/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/cumin/python/wooly/__init__.py 2007-11-02 21:51:36 UTC (rev 1228)
+++ mgmt/cumin/python/wooly/__init__.py 2007-11-02 22:16:50 UTC (rev 1229)
@@ -39,7 +39,7 @@
return self.cached_ancestors
def path(self):
- if not self.cached_path:
+ if self.cached_path == None:
if not self.parent:
self.cached_path = ""
elif not self.parent.parent:
@@ -50,7 +50,7 @@
return self.cached_path
def page(self):
- if not self.cached_page:
+ if self.cached_page == None:
if not self.parent:
self.cached_page = self
else:
@@ -182,7 +182,7 @@
self.cached_path = None
def path(self):
- if not self.cached_path:
+ if self.cached_path == None:
if not self.widget.parent:
self.cached_path = self.name
else:
@@ -510,8 +510,16 @@
vars = list()
for param in params:
- key = param.path()
+ #key = param.path()
+ # Inlined below saving about a half a second in a
+ # 1000-hit profile
+
+ if param.cached_path == None:
+ key = param.path()
+ else:
+ key = param.cached_path
+
if param.is_collection:
collection = self.get(key)
@@ -520,7 +528,18 @@
svalue = quote(param.marshal(value))
vars.append("%s=%s" % (key, svalue))
else:
- value = self.get(key)
+ #value = self.get(key)
+
+ # Inlined below saving about a second in a
+ # 1000-hit profile
+
+ if key in self.values:
+ value = self.values[key]
+ elif self.trunk:
+ value = self.trunk.get(key)
+ else:
+ value = None
+
default = param.get_default(self)
if value not in (default, None):
17 years, 1 month
rhmessaging commits: r1228 - mgmt/mint/xml.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2007-11-02 17:51:36 -0400 (Fri, 02 Nov 2007)
New Revision: 1228
Modified:
mgmt/mint/xml/MgmtSchema.xml
Log:
Changed types for reference elements to 'objId'
Modified: mgmt/mint/xml/MgmtSchema.xml
===================================================================
--- mgmt/mint/xml/MgmtSchema.xml 2007-11-02 21:37:21 UTC (rev 1227)
+++ mgmt/mint/xml/MgmtSchema.xml 2007-11-02 21:51:36 UTC (rev 1228)
@@ -57,7 +57,7 @@
===============================================================
-->
<object name="broker" schemaId="2">
- <configElement name="systemRef" type="string" access="RO" index="y" desc="System ID"/>
+ <configElement name="systemRef" type="objId" access="RO" index="y" desc="System ID"/>
<configElement name="port" type="uint16" access="RO" index="y" desc="TCP Port for AMQP Service"/>
<configElement name="workerThreads" type="uint16" access="RO" desc="Thread pool size"/>
<configElement name="maxConns" type="uint16" access="RO" desc="Maximum allowed connections"/>
@@ -85,7 +85,7 @@
===============================================================
-->
<object name="vhost" schemaId="3">
- <configElement name="brokerRef" type="string" access="RC" index="y"/>
+ <configElement name="brokerRef" type="objId" access="RC" index="y"/>
<configElement name="name" type="string" access="RC" index="y"/>
</object>
@@ -95,7 +95,7 @@
===============================================================
-->
<object name="queue" schemaId="4">
- <configElement name="vhostRef" type="string" access="RC" index="y"/>
+ <configElement name="vhostRef" type="objId" access="RC" index="y"/>
<configElement name="name" type="string" access="RC" index="y"/>
<configElement name="durable" type="bool" access="RC"/>
@@ -145,7 +145,7 @@
===============================================================
-->
<object name="exchange" schemaId="5">
- <configElement name="vhostRef" type="string" access="RC" index="y"/>
+ <configElement name="vhostRef" type="objId" access="RC" index="y"/>
<configElement name="name" type="string" access="RC" index="y"/>
<configElement name="type" type="string" access="RC"/>
@@ -165,8 +165,8 @@
===============================================================
-->
<object name="binding" schemaId="6">
- <configElement name="queueRef" type="string" access="RC" index="y"/>
- <configElement name="exchangeRef" type="string" access="RC" index="y"/>
+ <configElement name="queueRef" type="objId" access="RC" index="y"/>
+ <configElement name="exchangeRef" type="objId" access="RC" index="y"/>
<configElement name="bindingKey" type="string" access="RC"/>
<configElement name="arguments" type="fieldTable" access="RC"/>
@@ -179,7 +179,7 @@
===============================================================
-->
<object name="client" schemaId="7">
- <configElement name="vhostRef" type="string" index="y"/>
+ <configElement name="vhostRef" type="objId" index="y"/>
<configElement name="ipAddr" type="ipAddress" index="y"/>
<configElement name="port" type="uint16" index="y"/>
@@ -199,7 +199,7 @@
===============================================================
-->
<object name="session" schemaId="8">
- <configElement name="vhostRef" type="string" index="y"/>
+ <configElement name="vhostRef" type="objId" index="y"/>
<configElement name="name" type="string" index="y"/>
<configElement name="clientRef" type="string" access="RO"/>
<configElement name="detachedLifespan" type="uint32" access="RO"/>
@@ -220,7 +220,7 @@
===============================================================
-->
<object name="destination" schemaId="9">
- <configElement name="sessionRef" type="string" index="y"/>
+ <configElement name="sessionRef" type="objId" index="y"/>
<configElement name="name" type="string" index="y"/>
<instElement name="flowMode" type="enum(credit,window)"/>
@@ -243,8 +243,8 @@
===============================================================
-->
<object name="producer" schemaId="10">
- <configElement name="destinationRef" type="string" index="y"/>
- <configElement name="exchangeRef" type="string" index="y"/>
+ <configElement name="destinationRef" type="objId" index="y"/>
+ <configElement name="exchangeRef" type="objId" index="y"/>
<instElement name="msgsProduced" type="uint64"/>
<instElement name="bytesProduced" type="uint64"/>
@@ -256,8 +256,8 @@
===============================================================
-->
<object name="consumer" schemaId="11">
- <configElement name="destinationRef" type="string" index="y"/>
- <configElement name="queueRef" type="string" index="y"/>
+ <configElement name="destinationRef" type="objId" index="y"/>
+ <configElement name="queueRef" type="objId" index="y"/>
<instElement name="msgsConsumed" type="uint64"/>
<instElement name="bytesConsumed" type="uint64"/>
17 years, 1 month