rhmessaging commits: r1297 - in mgmt: cumin/python/wooly and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-13 11:14:26 -0500 (Tue, 13 Nov 2007)
New Revision: 1297
Modified:
mgmt/cumin/python/cumin/broker.strings
mgmt/cumin/python/cumin/brokergroup.strings
mgmt/cumin/python/cumin/brokerprofile.py
mgmt/cumin/python/cumin/brokerprofile.strings
mgmt/cumin/python/cumin/exchange.strings
mgmt/cumin/python/cumin/page.py
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/python/cumin/realm.strings
mgmt/cumin/python/cumin/widgets.strings
mgmt/cumin/python/wooly/forms.strings
mgmt/notes/justin-todo.txt
Log:
Adds broker profile add and edit forms. Also fixes form input focus
and tab indexing.
Modified: mgmt/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/cumin/python/cumin/broker.strings 2007-11-13 13:41:48 UTC (rev 1296)
+++ mgmt/cumin/python/cumin/broker.strings 2007-11-13 16:14:26 UTC (rev 1297)
@@ -134,7 +134,7 @@
</form>
<script defer="defer">
(function() {
- var elem = wooly.doc().elem("{id}").node.elements[1];
+ var elem = wooly.doc().elembyid("{id}").node.elements[1];
elem.focus();
elem.select();
}())
@@ -232,7 +232,7 @@
</form>
<script defer="defer">
(function() {
- var elem = wooly.doc().elem("{id}").node.elements[1];
+ var elem = wooly.doc().elembyid("{id}").node.elements[1];
elem.focus();
elem.select();
}())
Modified: mgmt/cumin/python/cumin/brokergroup.strings
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.strings 2007-11-13 13:41:48 UTC (rev 1296)
+++ mgmt/cumin/python/cumin/brokergroup.strings 2007-11-13 16:14:26 UTC (rev 1297)
@@ -48,7 +48,7 @@
{tabs}
[BrokerGroupForm.html]
-<form id="{id}" class="BrokerGroupForm mform" method="post" action="?">
+<form id="{id}" class="mform" method="post" action="?">
<div class="head">
<h1>{title}</h1>
</div>
@@ -66,7 +66,7 @@
</form>
<script defer="defer">
(function() {
- var elem = wooly.doc().elem("{id}").node.elements[1];
+ var elem = wooly.doc().elembyid("{id}").node.elements[1];
elem.focus();
elem.select();
}())
Modified: mgmt/cumin/python/cumin/brokerprofile.py
===================================================================
--- mgmt/cumin/python/cumin/brokerprofile.py 2007-11-13 13:41:48 UTC (rev 1296)
+++ mgmt/cumin/python/cumin/brokerprofile.py 2007-11-13 16:14:26 UTC (rev 1297)
@@ -10,6 +10,11 @@
strings = StringCatalog(__file__)
class BrokerProfileSet(ItemSet):
+ def render_profile_add_href(self, session, profile):
+ branch = session.branch()
+ self.page().show_broker_profile_add(branch)
+ return branch.marshal()
+
def get_items(self, session, model):
return sorted_by(model.get_broker_profiles())
@@ -30,6 +35,10 @@
self.add_mode(self.view)
self.set_view_mode(self.view)
+ self.edit = BrokerProfileEdit(app, "edit")
+ self.add_mode(self.edit)
+ self.set_edit_mode(self.edit)
+
def get_title(self, session, profile):
return "Broker Profile '%s'" % profile.name
@@ -49,6 +58,11 @@
def render_name(self, session, profile):
return profile.name
+ def render_edit_href(self, session, profile):
+ branch = session.branch()
+ self.page().show_broker_profile(branch, profile).show_edit(branch)
+ return branch.marshal()
+
class ProfileConfigTab(ConfigPropertySet):
def get_items(self, session, profile):
return sorted_by(profile.config_property_items())
@@ -82,3 +96,49 @@
diffs += 1
return "%i difference(s)" % diffs
+
+class BrokerProfileForm(CuminForm):
+ def __init__(self, app, name):
+ super(BrokerProfileForm, self).__init__(app, name)
+
+ self.profile_name = TextInput(app, "name", self)
+ self.add_child(self.profile_name)
+
+ def process_profile(self, session, profile):
+ profile.lock()
+ try:
+ profile.name = self.profile_name.get(session)
+ finally:
+ profile.unlock()
+
+ branch = session.branch()
+ self.page().show_broker_profile(branch, profile).show_view(branch)
+ self.page().set_redirect_url(session, branch.marshal())
+
+class BrokerProfileAdd(BrokerProfileForm, Frame):
+ def get_title(self, session, model):
+ return "Add Profile"
+
+ def process_cancel(self, session, model):
+ branch = session.branch()
+ self.page().show_view(branch)
+ self.page().set_redirect_url(session, branch.marshal())
+
+ def process_submit(self, session, model):
+ profile = BrokerProfile(model)
+ self.process_profile(session, profile)
+
+class BrokerProfileEdit(BrokerProfileForm, Frame):
+ def get_title(self, session, profile):
+ return "Edit Profile '%s'" % profile.name
+
+ def process_cancel(self, session, profile):
+ branch = session.branch()
+ self.parent.show_view(branch)
+ self.page().set_redirect_url(session, branch.marshal())
+
+ def process_submit(self, session, profile):
+ self.process_profile(session, profile)
+
+ def process_display(self, session, profile):
+ self.profile_name.set(session, profile.name)
Modified: mgmt/cumin/python/cumin/brokerprofile.strings
===================================================================
--- mgmt/cumin/python/cumin/brokerprofile.strings 2007-11-13 13:41:48 UTC (rev 1296)
+++ mgmt/cumin/python/cumin/brokerprofile.strings 2007-11-13 16:14:26 UTC (rev 1297)
@@ -1,9 +1,9 @@
[BrokerProfileSet.html]
<ul class="actions">
- <li><a class="nav" href="{href}">Add Broker Profile</a></li>
+ <li><a class="nav" href="{profile_add_href}">Add Broker Profile</a></li>
</ul>
-<table class="BrokerProfileSet mobjects">
+<table class="mobjects">
<tr>
<th>Name</th>
</tr>
@@ -24,7 +24,7 @@
<tr>
<th class="actions" colspan="2">
<h2>Act on This Profile:</h2>
- <a class="nav" href="{href}">Edit</a>
+ <a class="nav" href="{edit_href}">Edit</a>
<a href="{href}">Remove</a>
</th>
</tr>
@@ -74,3 +74,28 @@
<td>{item_link}</td>
<td><a href="{item_config_href}">{item_config_status}</a></td>
</tr>
+
+[BrokerProfileForm.html]
+<form id="{id}" class="mform" method="post" action="?">
+ <div class="head">
+ <h1>{title}</h1>
+ </div>
+ <div class="body">
+ <span class="legend">Name</span>
+ <fieldset>{name}</fieldset>
+
+ {hidden_inputs}
+ </div>
+ <div class="foot">
+ <a class="help action" href="{href}" target="help">Help</a>
+ {cancel}
+ {submit}
+ </div>
+</form>
+<script defer="defer">
+(function() {
+ var elem = wooly.doc().elembyid("{id}").node.elements[1];
+ elem.focus();
+ elem.select();
+}())
+</script>
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2007-11-13 13:41:48 UTC (rev 1296)
+++ mgmt/cumin/python/cumin/exchange.strings 2007-11-13 16:14:26 UTC (rev 1297)
@@ -1,6 +1,6 @@
[ExchangeInputSet.item_html]
<div class="field">
- <input type="radio" name="{name}" value="{item_value}" tabindex="{tabindex}" {item_checked_attr}/>
+ <input type="radio" name="{name}" value="{item_value}" tabindex="{tab_index}" {item_checked_attr}/>
{item_content}
</div>
@@ -77,7 +77,7 @@
<script defer="defer">
(function() {
// elements[0] is a fieldset, at least in firefox
- var elem = wooly.doc().elem("{id}").node.elements[1];
+ var elem = wooly.doc().elembyid("{id}").node.elements[1];
elem.focus();
elem.select();
}())
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2007-11-13 13:41:48 UTC (rev 1296)
+++ mgmt/cumin/python/cumin/page.py 2007-11-13 16:14:26 UTC (rev 1297)
@@ -44,6 +44,9 @@
self.profile = BrokerProfileFrame(app, "profile")
self.add_mode(self.profile)
+ self.profile_add = BrokerProfileAdd(app, "profileadd")
+ self.add_mode(self.profile_add)
+
self.cluster = BrokerClusterFrame(app, "cluster")
self.add_mode(self.cluster)
@@ -93,16 +96,20 @@
frame = self.show_mode(session, self.group_add)
return self.set_current_frame(session, frame)
+ def show_broker_profile(self, session, profile):
+ frame = self.show_mode(session, self.profile)
+ frame.set_object(session, profile)
+ return self.set_current_frame(session, frame)
+
+ def show_broker_profile_add(self, session):
+ frame = self.show_mode(session, self.profile_add)
+ return self.set_current_frame(session, frame)
+
def show_broker_cluster(self, session, cluster):
frame = self.show_mode(session, self.cluster)
frame.set_object(session, cluster)
return self.set_current_frame(session, frame)
- def show_broker_profile(self, session, profile):
- frame = self.show_mode(session, self.profile)
- frame.set_object(session, profile)
- return self.set_current_frame(session, frame)
-
def show_queue(self, session, queue):
broker = queue.get_virtual_host().get_broker()
frame = self.show_broker(session, broker)
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-13 13:41:48 UTC (rev 1296)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-13 16:14:26 UTC (rev 1297)
@@ -82,7 +82,7 @@
</form>
<script defer="defer">
(function() {
- var elem = wooly.doc().elem("{id}").node.elements[1];
+ var elem = wooly.doc().elembyid("{id}").node.elements[1];
elem.focus();
elem.select();
}())
@@ -229,7 +229,7 @@
</form>
<script defer="defer">
(function() {
- var elem = wooly.doc().elem("{id}").node.elements[1];
+ var elem = wooly.doc().elembyid("{id}").node.elements[1];
elem.focus();
elem.select();
}())
Modified: mgmt/cumin/python/cumin/realm.strings
===================================================================
--- mgmt/cumin/python/cumin/realm.strings 2007-11-13 13:41:48 UTC (rev 1296)
+++ mgmt/cumin/python/cumin/realm.strings 2007-11-13 16:14:26 UTC (rev 1297)
@@ -1,6 +1,6 @@
[RealmInputSet.item_html]
<div class="field">
- <input type="checkbox" name="{name}" value="{item_value}" tabindex="{tabindex}" {item_checked_attr}/>
+ <input type="checkbox" name="{name}" value="{item_value}" tabindex="{tab_index}" {item_checked_attr}/>
{item_content}
</div>
Modified: mgmt/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/cumin/python/cumin/widgets.strings 2007-11-13 13:41:48 UTC (rev 1296)
+++ mgmt/cumin/python/cumin/widgets.strings 2007-11-13 16:14:26 UTC (rev 1297)
@@ -10,7 +10,7 @@
</div>
</form>
<script>
-wooly.doc().elem("{id}").node.elements[1].focus();
+ wooly.doc().elembyid("{id}").node.elements[1].focus();
</script>
[CuminStatus.html]
Modified: mgmt/cumin/python/wooly/forms.strings
===================================================================
--- mgmt/cumin/python/wooly/forms.strings 2007-11-13 13:41:48 UTC (rev 1296)
+++ mgmt/cumin/python/wooly/forms.strings 2007-11-13 16:14:26 UTC (rev 1297)
@@ -1,5 +1,5 @@
[FormButton.html]
-<button id="{id}" type="submit" name="{name}" value="{value}" tabindex="{tabindex}" {disabled_attr}>{content}</button>
+<button id="{id}" type="submit" name="{name}" value="{value}" tabindex="{tab_index}" {disabled_attr}>{content}</button>
[FormInput.errors_html]
<ul class="errors">{error_messages}</ul>
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-13 13:41:48 UTC (rev 1296)
+++ mgmt/notes/justin-todo.txt 2007-11-13 16:14:26 UTC (rev 1297)
@@ -8,6 +8,9 @@
Deferred
+ * Add a wooly.focus(id) method to replace the ad-hoc javascript I'm
+ using
+
* Think about making css and jscript pages produce their document in
some kind of widget-tree traversal order
17 years, 1 month
rhmessaging commits: r1296 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: cctrieloff
Date: 2007-11-13 08:41:48 -0500 (Tue, 13 Nov 2007)
New Revision: 1296
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
Log:
- check AIO busy
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2007-11-13 05:23:59 UTC (rev 1295)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2007-11-13 13:41:48 UTC (rev 1296)
@@ -1050,7 +1050,6 @@
void BdbMessageStore::async_dequeue(TransactionContext* ctxt, PersistableMessage& msg, const PersistableQueue& queue)
{
-// unsigned aio_sleep_cnt = 0;
bool written = false;
boost::intrusive_ptr<DataTokenImpl> ddtokp(new DataTokenImpl);
ddtokp->ref();
@@ -1087,6 +1086,9 @@
usleep(AIO_SLEEP_TIME); // TODO add sleep time to get events call as option
jc->get_wr_events();
break;
+ case rhm::journal::RHM_IORES_BUSY:
+ usleep(AIO_SLEEP_TIME); // TODO add sleep time to get events call as option
+ break;
default:
assert( "Store Error: Unexpected msg state");
}
17 years, 1 month
rhmessaging commits: r1295 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-13 00:23:59 -0500 (Tue, 13 Nov 2007)
New Revision: 1295
Modified:
mgmt/cumin/python/cumin/client.strings
mgmt/cumin/python/cumin/exchange.strings
mgmt/notes/justin-todo.txt
Log:
Ajaxifies all charts.
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-11-13 05:13:56 UTC (rev 1294)
+++ mgmt/cumin/python/cumin/client.strings 2007-11-13 05:23:59 UTC (rev 1295)
@@ -138,14 +138,19 @@
[StatisticsHistory.html]
<h2>Produced</h2>
<div class="iblock chart">
- <img src="{produced_chart_url}"/>
+ <img id="{id}.produced" src="{produced_chart_url}"/>
</div>
<h2>Consumed</h2>
<div class="iblock chart">
- <img src="{consumed_chart_url}"/>
+ <img id="{id}.consumed" src="{consumed_chart_url}"/>
</div>
+<script>
+ cumin.client.listeners["{id}.produced"] = updateImage
+ cumin.client.listeners["{id}.consumed"] = updateImage
+</script>
+
[ClientSessionSet.html]
<div class="sactions">
<h2>Act on Selected Sessions:</h2>
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2007-11-13 05:13:56 UTC (rev 1294)
+++ mgmt/cumin/python/cumin/exchange.strings 2007-11-13 05:23:59 UTC (rev 1295)
@@ -206,19 +206,25 @@
[StatisticsHistory.html]
<h2>Received</h2>
<div class="iblock chart">
- <img src="{received_chart_url}"/>
+ <img id="{id}.received" src="{received_chart_url}"/>
</div>
-<h2>Dropped</h2>
+<h2>Routed</h2>
<div class="iblock chart">
- <img src="{dropped_chart_url}"/>
+ <img id="{id}.routed" src="{routed_chart_url}"/>
</div>
-<h2>Routed</h2>
+<h2>Dropped</h2>
<div class="iblock chart">
- <img src="{routed_chart_url}"/>
+ <img id="{id}.dropped" src="{dropped_chart_url}"/>
</div>
+<script>
+ cumin.exchange.listeners["{id}.received"] = updateImage
+ cumin.exchange.listeners["{id}.routed"] = updateImage
+ cumin.exchange.listeners["{id}.dropped"] = updateImage
+</script>
+
[ExchangeProducerSet.html]
<div class="sactions">
<h2>Act on Selected Producers:</h2>
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-13 05:13:56 UTC (rev 1294)
+++ mgmt/notes/justin-todo.txt 2007-11-13 05:23:59 UTC (rev 1295)
@@ -6,12 +6,6 @@
* Pagination and sort in tables
- * Exchange: ajaxify charts
-
- * Client: ajaxify charts
-
- * Queue: ajaxify charts
-
Deferred
* Think about making css and jscript pages produce their document in
17 years, 1 month
rhmessaging commits: r1294 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-13 00:13:56 -0500 (Tue, 13 Nov 2007)
New Revision: 1294
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/model.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/python/cumin/widgets.py
Log:
In preparation for ajaxified list views, adapts model object xml and
their pages to produce xml not just for one object at a time but for
many.
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-11-13 04:13:39 UTC (rev 1293)
+++ mgmt/cumin/python/cumin/client.py 2007-11-13 05:13:56 UTC (rev 1294)
@@ -178,9 +178,13 @@
def __init__(self, app, name):
super(ClientXmlPage, self).__init__(app, name)
- self.client = ClientParameter(app, "id")
- self.add_parameter(self.client)
- self.set_object_parameter(self.client)
+ self.param = ClientParameter(app, "param")
+ self.add_parameter(self.param)
+
+ self.clients = ListParameter(app, "id", self.param)
+ self.add_parameter(self.clients)
+
+ self.set_list_parameter(self.clients)
class ClientChartPage(CuminChartPage):
def __init__(self, app, name):
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-11-13 04:13:39 UTC (rev 1293)
+++ mgmt/cumin/python/cumin/client.strings 2007-11-13 05:13:56 UTC (rev 1294)
@@ -78,8 +78,14 @@
[ClientView.javascript]
function updateClient(data) {
- var client = data.root().object();
+ var clients = data.root().object().client;
+ var client;
+ for (var key in clients) {
+ client = clients[key];
+ break;
+ }
+
for (var id in cumin.client.listeners) {
cumin.client.listeners[id](id, client);
}
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-11-13 04:13:39 UTC (rev 1293)
+++ mgmt/cumin/python/cumin/exchange.py 2007-11-13 05:13:56 UTC (rev 1294)
@@ -393,9 +393,13 @@
def __init__(self, app, name):
super(ExchangeXmlPage, self).__init__(app, name)
- self.exchange = ExchangeParameter(app, "id")
- self.add_parameter(self.exchange)
- self.set_object_parameter(self.exchange)
+ self.param = ExchangeParameter(app, "param")
+ self.add_parameter(self.param)
+
+ self.exchanges = ListParameter(app, "id", self.param)
+ self.add_parameter(self.exchanges)
+
+ self.set_list_parameter(self.exchanges)
class ExchangeChartPage(CuminChartPage):
def __init__(self, app, name):
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2007-11-13 04:13:39 UTC (rev 1293)
+++ mgmt/cumin/python/cumin/exchange.strings 2007-11-13 05:13:56 UTC (rev 1294)
@@ -135,8 +135,13 @@
[ExchangeView.javascript]
function updateExchange(data) {
- var exchange = data.root().object();
+ var exchanges = data.root().object().exchange;
+ var exchange;
+ for (var key in exchanges) {
+ exchange = exchanges[key];
+ }
+
for (var id in cumin.exchange.listeners) {
cumin.exchange.listeners[id](id, exchange);
}
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-13 04:13:39 UTC (rev 1293)
+++ mgmt/cumin/python/cumin/model.py 2007-11-13 05:13:56 UTC (rev 1294)
@@ -594,17 +594,8 @@
def write_xml(self, writer):
writer.write("<queue id=\"queue-%i\">" % self.id)
writer.write("<name>%s</name>" % self.name)
- writer.write("<latency-priority>%s</latency-priority>" \
- % self.latency_priority)
self.write_error_xml(writer)
-
- for realm in self.realm_items():
- writer.write("<realm ref=\"realm-%i\"/>" % realm.id)
-
- for binding in self.binding_items():
- binding.write_xml(writer)
-
self.write_measurement_xml(writer)
writer.write("</queue>")
@@ -706,13 +697,6 @@
writer.write("<name>%s</name>" % self.name)
self.write_error_xml(writer)
-
- for realm in self.realm_items():
- writer.write("<realm ref=\"realm-%i\"/>" % realm.id)
-
- for binding in self.binding_items():
- binding.write_xml(writer)
-
self.write_measurement_xml(writer)
writer.write("</exchange>")
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-13 04:13:39 UTC (rev 1293)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-13 05:13:56 UTC (rev 1294)
@@ -474,10 +474,14 @@
def __init__(self, app, name):
super(QueueXmlPage, self).__init__(app, name)
- self.queue = QueueParameter(app, "id")
- self.add_parameter(self.queue)
- self.set_object_parameter(self.queue)
+ self.param = QueueParameter(app, "param")
+ self.add_parameter(self.param)
+ self.queues = ListParameter(app, "id", self.param)
+ self.add_parameter(self.queues)
+
+ self.set_list_parameter(self.queues)
+
class QueueChartPage(CuminChartPage):
def __init__(self, app, name):
super(QueueChartPage, self).__init__(app, name)
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-13 04:13:39 UTC (rev 1293)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-13 05:13:56 UTC (rev 1294)
@@ -146,8 +146,14 @@
[QueueView.javascript]
function updateQueue(data) {
- var queue = data.root().object();
+ var queues = data.root().object().queue;
+ var queue;
+ for (var key in queues) {
+ queue = queues[key];
+ break;
+ }
+
for (var id in cumin.queue.listeners) {
cumin.queue.listeners[id](id, queue);
}
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2007-11-13 04:13:39 UTC (rev 1293)
+++ mgmt/cumin/python/cumin/widgets.py 2007-11-13 05:13:56 UTC (rev 1294)
@@ -178,21 +178,25 @@
self.__param = None
- def set_object_parameter(self, param):
+ def set_list_parameter(self, param):
self.__param = param
- def get_object(self, session, object):
+ def get_object(self, session, objects):
return self.__param.get(session)
def get_content_type(self, session):
return Page.xml_content_type
- def do_render(self, session, object):
+ def do_render(self, session, objects):
writer = Writer()
writer.write(Page.xml_1_0_declaration)
+ writer.write("<objects>");
- object.write_xml(writer)
+ for object in objects:
+ object.write_xml(writer)
+
+ writer.write("</objects>");
return writer.to_string()
17 years, 1 month
rhmessaging commits: r1293 - store/trunk/cpp/tests/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2007-11-12 23:13:39 -0500 (Mon, 12 Nov 2007)
New Revision: 1293
Added:
store/trunk/cpp/tests/jrnl/unit_test_jdir.cpp
Modified:
store/trunk/cpp/tests/jrnl/Makefile.am
store/trunk/cpp/tests/jrnl/unit_test_jerrno.cpp
store/trunk/cpp/tests/jrnl/unit_test_jinf.cpp
Log:
Some unit tests for class jdir
Modified: store/trunk/cpp/tests/jrnl/Makefile.am
===================================================================
--- store/trunk/cpp/tests/jrnl/Makefile.am 2007-11-12 22:57:21 UTC (rev 1292)
+++ store/trunk/cpp/tests/jrnl/Makefile.am 2007-11-13 04:13:39 UTC (rev 1293)
@@ -29,6 +29,7 @@
unit_test_jexception \
unit_test_jerrno \
unit_test_jinf \
+ unit_test_jdir \
run-journal-tests
check_LTLIBRARIES = \
@@ -38,7 +39,8 @@
check_PROGRAMS = \
unit_test_jexception \
unit_test_jerrno \
- unit_test_jinf
+ unit_test_jinf \
+ unit_test_jdir
unit_test_jexception_SOURCES = unit_test_jexception.cpp
unit_test_jexception_LDFLAGS = -lboost_unit_test_framework -lbdbstore -L../../lib/.libs
@@ -49,6 +51,9 @@
unit_test_jinf_SOURCES = unit_test_jinf.cpp
unit_test_jinf_LDFLAGS = -lboost_unit_test_framework -lbdbstore -lrt -L../../lib/.libs
+unit_test_jdir_SOURCES = unit_test_jdir.cpp
+unit_test_jdir_LDFLAGS = -lboost_unit_test_framework -lbdbstore -lrt -L../../lib/.libs
+
JournalSystemTests_la_SOURCES = \
JournalSystemTests.cpp \
JournalSystemTests.hpp
Added: store/trunk/cpp/tests/jrnl/unit_test_jdir.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/unit_test_jdir.cpp (rev 0)
+++ store/trunk/cpp/tests/jrnl/unit_test_jdir.cpp 2007-11-13 04:13:39 UTC (rev 1293)
@@ -0,0 +1,193 @@
+/**
+* \file unit_test_jdir.cpp
+*
+* Red Hat Messaging - Message Journal
+*
+* This file contains the unit tests for the journal.
+*
+* \author Kim van der Riet
+*
+* Copyright 2007 Red Hat, Inc.
+*
+* This file is part of Red Hat Messaging.
+*
+* Red Hat Messaging is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+* USA
+*
+* The GNU Lesser General Public License is available in the file COPYING.
+*/
+
+#include <boost/test/results_reporter.hpp>
+#include <boost/test/unit_test.hpp>
+#include <boost/test/unit_test_log.hpp>
+#include <iostream>
+#include <jrnl/jdir.hpp>
+#include <jrnl/jerrno.hpp>
+#include <jrnl/jexception.hpp>
+
+#define ERRORSTR(e) ::strerror(ret) << " (" << ret << ")"
+
+using namespace boost::unit_test;
+using namespace rhm::journal;
+
+// Test functions of the form
+// void fn() {...}
+
+void test_constructor()
+{
+ std::string dir("/tmp/A/B/C/D/E/F");
+ std::string bfn("test_base");
+ jdir dir1(dir, bfn);
+ BOOST_CHECK(dir1.dirname().compare(dir) == 0);
+ BOOST_CHECK(dir1.base_filename().compare(bfn) == 0);
+}
+
+void test_create_delete_dir()
+{
+ std::string dir_A("/tmp/A");
+ std::string dir_Ats("/tmp/A/"); // trailing '/'
+ std::string dir_Bts("/tmp/B/"); // trailing '/'
+ std::string dir_C("/tmp/C");
+ std::string dir_Dts("/tmp/D/"); // trailing '/'
+ std::string dir_X("/tmp/X");
+ std::string dir_Xts("/tmp/X/"); // trailing '/'
+ std::string bfn("test_base");
+
+ // Use instance
+ jdir dir1(dir_A, bfn);
+ dir1.create_dir();
+ // check all combos of jdir::exists and jdir::is_dir()
+ BOOST_CHECK(jdir::exists(dir_A));
+ BOOST_CHECK(jdir::exists(dir_Ats));
+ BOOST_CHECK(jdir::exists(dir_A.c_str()));
+ BOOST_CHECK(jdir::exists(dir_Ats.c_str()));
+ BOOST_CHECK(jdir::is_dir(dir_A));
+ BOOST_CHECK(jdir::is_dir(dir_Ats));
+ BOOST_CHECK(jdir::is_dir(dir_Ats.c_str()));
+ BOOST_CHECK(jdir::is_dir(dir_Ats.c_str()));
+
+ // Check non-existent dirs fail
+ BOOST_CHECK(!jdir::exists(dir_X));
+ BOOST_CHECK(!jdir::exists(dir_Xts));
+ try
+ {
+ jdir::is_dir(dir_X);
+ BOOST_ERROR("jdir::is_dir() failed to throw jexeption for non-existent directory.");
+ }
+ catch(const jexception e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), jerrno::JERR_JDIR_STAT);
+ }
+ try
+ {
+ jdir::is_dir(dir_Xts);
+ BOOST_ERROR("jdir::is_dir() failed to throw jexeption for non-existent directory.");
+ }
+ catch(const jexception e)
+ {
+ BOOST_CHECK_EQUAL(e.err_code(), jerrno::JERR_JDIR_STAT);
+ }
+
+ jdir dir2(dir_Bts, bfn);
+ dir2.create_dir();
+ BOOST_CHECK(jdir::is_dir(dir_Bts));
+
+ // static fn
+ jdir::create_dir(dir_C);
+ BOOST_CHECK(jdir::is_dir(dir_C));
+ jdir::create_dir(dir_Dts);
+ BOOST_CHECK(jdir::is_dir(dir_Dts));
+
+ // Clean up with delete_dir
+ dir1.delete_dir();
+ BOOST_CHECK(!jdir::exists(dir_A));
+ dir2.delete_dir();
+ BOOST_CHECK(!jdir::exists(dir_Bts));
+ // static fn
+ jdir::delete_dir(dir_C);
+ BOOST_CHECK(!jdir::exists(dir_C));
+ jdir::delete_dir(dir_Dts);
+ BOOST_CHECK(!jdir::exists(dir_Dts));
+}
+
+void test_create_delete_dir_recursive()
+{
+ std::string dir_E("/tmp/E/F/G/H");
+ std::string dir_Eb("/tmp/E"); // base dir
+ std::string dir_F("/tmp/F/G/H/I/"); // trailing '/'
+ std::string dir_Fb("/tmp/F"); // base dir
+ std::string dir_G("/tmp/G/H/I/J");
+ std::string dir_Gb("/tmp/G"); // base dir
+ std::string dir_H("/tmp/H/I/J/K/"); // trailing '/'
+ std::string dir_Hb("/tmp/H"); // base dir
+ std::string bfn("test_base");
+
+ // Use instances
+ jdir dir1(dir_E, bfn);
+ dir1.create_dir();
+ BOOST_CHECK(jdir::is_dir(dir_E));
+ jdir dir2(dir_F, bfn);
+ dir2.create_dir();
+ BOOST_CHECK(jdir::is_dir(dir_F));
+
+ // static fn
+ jdir::create_dir(dir_G);
+ BOOST_CHECK(jdir::is_dir(dir_G));
+ jdir::create_dir(dir_H);
+ BOOST_CHECK(jdir::is_dir(dir_H));
+
+ // Clean up with delete_dir
+ dir1.delete_dir();
+ BOOST_CHECK(!jdir::exists(dir_E)); // only H deleted, E/F/G remain
+ BOOST_CHECK(jdir::exists(dir_Eb));
+ jdir::delete_dir(dir_Eb); // delete remaining dirs
+ BOOST_CHECK(!jdir::exists(dir_Eb));
+
+ dir2.delete_dir();
+ BOOST_CHECK(!jdir::exists(dir_F));
+ BOOST_CHECK(jdir::exists(dir_Fb));
+ jdir::delete_dir(dir_Fb);
+ BOOST_CHECK(!jdir::exists(dir_Fb));
+
+ // static fn
+ jdir::delete_dir(dir_G);
+ BOOST_CHECK(!jdir::exists(dir_G));
+ BOOST_CHECK(jdir::exists(dir_Gb));
+ jdir::delete_dir(dir_Gb);
+ BOOST_CHECK(!jdir::exists(dir_Gb));
+
+ jdir::delete_dir(dir_H);
+ BOOST_CHECK(!jdir::exists(dir_H));
+ BOOST_CHECK(jdir::exists(dir_Hb));
+ jdir::delete_dir(dir_Hb);
+ BOOST_CHECK(!jdir::exists(dir_Hb));
+}
+
+// Initialize test suite and include test functions
+
+test_suite* init_unit_test_suite(int, char**)
+{
+ std::cout << "--------" << std::endl << "unit_test_jdir: ";
+ test_suite* ts = BOOST_TEST_SUITE("unit_test_jdir");
+
+ results_reporter::set_level(SHORT_REPORT);
+ unit_test_log_t::instance().set_threshold_level(log_messages);
+
+ ts->add(BOOST_TEST_CASE(&test_constructor));
+ ts->add(BOOST_TEST_CASE(&test_create_delete_dir));
+ ts->add(BOOST_TEST_CASE(&test_create_delete_dir_recursive));
+
+ return ts;
+}
Modified: store/trunk/cpp/tests/jrnl/unit_test_jerrno.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/unit_test_jerrno.cpp 2007-11-12 22:57:21 UTC (rev 1292)
+++ store/trunk/cpp/tests/jrnl/unit_test_jerrno.cpp 2007-11-13 04:13:39 UTC (rev 1293)
@@ -1,5 +1,5 @@
/**
-* \file unit_test_jexception.cpp
+* \file unit_test_jerrno.cpp
*
* Red Hat Messaging - Message Journal
*
Modified: store/trunk/cpp/tests/jrnl/unit_test_jinf.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/unit_test_jinf.cpp 2007-11-12 22:57:21 UTC (rev 1292)
+++ store/trunk/cpp/tests/jrnl/unit_test_jinf.cpp 2007-11-13 04:13:39 UTC (rev 1293)
@@ -1,5 +1,5 @@
/**
-* \file unit_test_jexception.cpp
+* \file unit_test_jinf.cpp
*
* Red Hat Messaging - Message Journal
*
@@ -43,9 +43,6 @@
using namespace boost::unit_test;
using namespace rhm::journal;
-// Test functions of the form
-// void fn() {...}
-
const std::string jid("test journal id");
const std::string jdir("/tmp");
const std::string base_filename("test_base");
@@ -61,6 +58,9 @@
void clean_journal_info_file();
+// Test functions of the form
+// void fn() {...}
+
void test_write_constructor()
{
::clock_gettime(CLOCK_REALTIME, &ts);
17 years, 1 month
rhmessaging commits: r1292 - in mgmt/cumin: resources and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-12 17:57:21 -0500 (Mon, 12 Nov 2007)
New Revision: 1292
Modified:
mgmt/cumin/python/cumin/page.strings
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/resources/wooly.js
Log:
Fixes refreshing chart urls, such that they don't expand forever.
Improves the javascript code a bit; makes it a little more efficient
for common operations.
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-11-12 22:37:37 UTC (rev 1291)
+++ mgmt/cumin/python/cumin/page.strings 2007-11-12 22:57:21 UTC (rev 1292)
@@ -574,25 +574,30 @@
var status = wooly.doc().elembyid(id);
if (ecount != "0") {
- status.node.className = "mstatus red";
+ status.setattr("class", "mstatus red");
} else if (wcount != "0") {
- status.node.className = "mstatus yellow";
+ status.setattr("class", "mstatus yellow");
} else {
- status.node.className = "mstatus green";
+ status.setattr("class", "mstatus green");
}
status.elem("div").set(errors + ", " + warnings);
}
-counter = 0;
-
function updateImage(id, object) {
var img = wooly.doc().elembyid(id);
- src = img.getattr("src");
- sep = src.lastIndexOf(";");
+ var src = img.getattr("src");
+ var sep = src.lastIndexOf(";");
+ var time = new Date().getTime();
- img.setattr("src", src + ";");
+ if (isNaN(parseInt(src.substring(sep + 1)))) {
+ src = src + ";" + time;
+ } else {
+ src = src.substring(0, sep) + ";" + time;
+ }
+
+ img.setattr("src", src);
}
[CuminPage.html]
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-12 22:37:37 UTC (rev 1291)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-12 22:57:21 UTC (rev 1292)
@@ -151,6 +151,8 @@
for (var id in cumin.queue.listeners) {
cumin.queue.listeners[id](id, queue);
}
+
+ //throw new Error();
}
[QueueView.html]
Modified: mgmt/cumin/resources/wooly.js
===================================================================
--- mgmt/cumin/resources/wooly.js 2007-11-12 22:37:37 UTC (rev 1291)
+++ mgmt/cumin/resources/wooly.js 2007-11-12 22:57:21 UTC (rev 1292)
@@ -140,17 +140,33 @@
return node;
}
+ function findexpr(found, limit, node, expr) {
+ var result = document.evaluate
+ (expr, node, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
+
+ var node = result.iterateNext();
+
+ for (var i = 0; node != null && i < limit; i++) {
+ found.push(node);
+ node = result.iterateNext();
+ }
+
+ return found;
+ }
+
function find(found, limit,
- nodeParent, nodeType, nodeName,
+ node, nodeType, nodeName,
attr, attrValue) {
+ //log("find", found, limit, node, nodeType, nodeName, attr, attrValue);
+
/*
assert(found);
assert(found instanceof Array);
- assert(nodeParent);
+ assert(node);
assert(nodeType);
*/
- var children = nodeParent.childNodes;
+ var children = node.childNodes;
for (var i = 0; i < children.length; i++) {
var child = children[i];
@@ -176,7 +192,7 @@
if (found.length == limit) {
return;
}
- } else {
+ } else if (child.nodeType == 1) {
find(found, limit, child, nodeType, nodeName, attr, attrValue);
}
}
@@ -255,13 +271,13 @@
}
var nodes = this.node.getElementsByTagName(name);
- var iter = new WoolyIterator(this, nodes, WoolyElement);
+ var coll = new WoolyCollection(this, nodes, WoolyElement);
for (var i = 0; i < start; i++) {
- iter.next();
+ coll.next();
}
- return iter;
+ return coll;
}
this.elem = function(name, n) {
@@ -269,7 +285,7 @@
}
}
- function WoolyIterator(doc, nodes, nodeClass) {
+ function WoolyCollection(doc, nodes, nodeClass) {
assert(doc);
assert(nodes);
assert(nodeClass);
@@ -281,7 +297,7 @@
this.pos = 0;
this.next = function() {
- var node = nodes[this.pos++]
+ var node = this.nodes[this.pos++];
if (node) {
return new this.nodeClass(this.doc, node);
@@ -289,6 +305,16 @@
return null;
}
}
+
+ this.get = function(index) {
+ var node = this.nodes[index];
+
+ if (node) {
+ return new this.nodeClass(this.doc, node);
+ } else {
+ return null;
+ }
+ }
}
function WoolyElement(doc, node) {
@@ -378,17 +404,17 @@
find(nodes, limit, this.node, 1, name, attr, attrValue);
- var iter = new WoolyIterator(this.doc, nodes, WoolyElement);
+ var coll = new WoolyCollection(this.doc, nodes, WoolyElement);
for (var i = 0; i < start; i++) {
- iter.next();
+ coll.next();
}
- return iter;
+ return coll;
}
- this.elem = function(name, attr, attrValue, n) {
- return this.elems(name, attr, attrValue, n, n + 1).next();
+ this.elem = function(name, attr, attrValue) {
+ return this.elems(name, attr, attrValue, 0, 1).next();
}
this.texts = function(start, limit) {
@@ -396,13 +422,13 @@
find(nodes, limit, this.node, 3);
- var iter = new WoolyIterator(this.doc, nodes, WoolyText);
+ var coll = new WoolyCollection(this.doc, nodes, WoolyText);
for (var i = 0; i < start; i++) {
- iter.next();
+ coll.next();
}
- return iter;
+ return coll;
}
this.text = function() {
17 years, 1 month
rhmessaging commits: r1291 - mgmt/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2007-11-12 17:37:37 -0500 (Mon, 12 Nov 2007)
New Revision: 1291
Added:
mgmt/mint/model.py
Modified:
mgmt/mint/config.xml
mgmt/mint/schemaparser.py
Log:
refactored test code into model.py
Modified: mgmt/mint/config.xml
===================================================================
--- mgmt/mint/config.xml 2007-11-12 21:55:30 UTC (rev 1290)
+++ mgmt/mint/config.xml 2007-11-12 22:37:37 UTC (rev 1291)
@@ -1,6 +1,6 @@
<config>
<configOption name="dsn" value="postgresql://localhost/" />
- <configOption name="pythonOutput" value="schema.out.py" />
- <configOption name="sqlOutput" value="schema.out.sql" />
+ <configOption name="pythonOutput" value="schema.py" />
+ <configOption name="sqlOutput" value="schema.sql" />
<configOption name="schemaXML" value="xml/MgmtSchema.xml" />
</config>
Added: mgmt/mint/model.py
===================================================================
--- mgmt/mint/model.py (rev 0)
+++ mgmt/mint/model.py 2007-11-12 22:37:37 UTC (rev 1291)
@@ -0,0 +1,184 @@
+from qpid.management import ManagedBroker
+from schema import *
+from time import sleep
+from datetime import *
+from sqlobject import *
+
+class Model:
+ currentMethodId = None
+ outstandingMethodCalls = None
+
+ def __init__(self):
+ self.currentMethodId = 1
+ self.outstandingMethodCalls = dict()
+
+ def getQueueByOriginalId(self, id, create=False):
+ queue = None
+ try:
+ queues = MgmtQueue.selectBy(idOriginal=id)[:1]
+ queue = queues[0]
+ except IndexError:
+ if (create): queue = MgmtQueue(idOriginal=id)
+ return queue
+
+ def getQueueByName(self, name, vhost, create=False):
+ queue = None
+ try:
+ queues = MgmtQueue.selectBy(name=name, mgmtVhost=vhost)[:1]
+ queue = queues[0]
+ except IndexError:
+ if (create): queue = MgmtQueue(name=name, mgmtVhost=vhost)
+ return queue
+
+ def getVhostByName(self, name, broker, create=False):
+ vhost = None
+ try:
+ vhosts = MgmtVhost.selectBy(name=name, mgmtBroker=broker)[:1]
+ vhost = vhosts[0]
+ except IndexError:
+ if (create): vhost = MgmtVhost(name=name, mgmtBroker=broker)
+ return vhost
+
+ def getVhostByOriginalId(self, id, create=False):
+ vhost = None
+ try:
+ vhosts = MgmtVhost.selectBy(idOriginal=id)[:1]
+ vhost = vhosts[0]
+ except IndexError:
+ if (create): vhost = MgmtVhost(idOriginal=id)
+ return vhost
+
+ def getBrokerByPort(self, port, system, create=False):
+ broker = None
+ try:
+ brokers = MgmtBroker.selectBy(port=port, mgmtSystem=system)[:1]
+ broker = brokers[0]
+ except IndexError:
+ if (create): broker = MgmtBroker(port=port, mgmtSystem=system)
+ return broker
+
+ def getBrokerByOriginalId(self, id, create=False):
+ broker = None
+ try:
+ brokers = MgmtBroker.selectBy(idOriginal=id)[:1]
+ broker = brokers[0]
+ except IndexError:
+ if (create): broker = MgmtBroker(idOriginal=id)
+ return broker
+
+ def getSystemByOriginalId(self, id, create=False):
+ system = None
+ try:
+ systems = MgmtSystem.selectBy(idOriginal=id)[:1]
+ system = systems[0]
+ except IndexError:
+ if (create): system = MgmtSystem(idOriginal=id)
+ return system
+
+ def sanitizeDict(self, d):
+ for k in d.iterkeys():
+ if (k.endswith("Id")):
+ d[self.convertKey(k)] = d.pop(k)
+ elif (k == "id"):
+ d[self.convertKey(k)] = d.pop(k)
+ for k in d.iterkeys():
+ if (k.endswith("Ref")):
+ d[self.convertKey(k)] = d.pop(k)
+ return d
+
+ def convertKey(self, k):
+ if (k == "id"):
+ return k + "Original"
+ if (k.endswith("Id")):
+ return k + "ent"
+ elif (k.endswith("Ref")):
+ oldK = k
+ k = k[0].upper() + k[1:]
+ return "mgmt" + k.replace("Ref", "ID")
+
+ def configCallback(self, broker, objectName, list, timestamps):
+ print "\nCONFIG---------------------------------------------------"
+ print "broker=" + broker
+ print objectName
+ print list
+ result = None
+ d = self.sanitizeDict(dict(list))
+
+ print d
+
+ d["recTime"] = datetime.fromtimestamp(timestamps[0]/1000000000)
+ d["creationTime"] = datetime.fromtimestamp(timestamps[1]/1000000000)
+ if (objectName == "Queue"):
+ print "* QUEUE"
+ queue = self.getQueueByName(d["name"], self.getVhostByOriginalId(d.pop(self.convertKey("vhostRef"))), True)
+ queue.set(**d)
+ print queue.id
+ print " -> " + queue.name
+ result = queue
+ elif (objectName == "Vhost"):
+ print "* VHOST"
+ vhost = self.getVhostByName(d["name"], self.getBrokerByOriginalId(d.pop(self.convertKey("brokerRef"))), True)
+ vhost.set(**d)
+ print vhost.id
+ print " -> " + vhost.name
+ result = vhost
+ elif (objectName == "Broker"):
+ print "* BROKER"
+ d.pop(self.convertKey("systemRef"))
+ broker = self.getBrokerByPort(d["port"], self.getSystemByOriginalId("123456789"), True)
+ broker.set(**d)
+ print broker.id
+ result = broker
+ print "END CONFIG---------------------------------------------------\n"
+ return result
+
+ def instCallback(self, broker, objectName, list, timestamps):
+ print "\nINST---------------------------------------------------"
+ print "broker=" + broker
+ print objectName
+ print list
+ result = None
+ d = self.sanitizeDict(dict(list))
+ if (objectName == "Queue"):
+ print "* QUEUE"
+ queue = self.getQueueByOriginalId(d[self.convertKey("id")])
+ d["mgmtQueue"] = queue.id
+ d["recTime"] = datetime.fromtimestamp(timestamps[0]/1000000000)
+ queueStats = MgmtQueueStats()
+ queueStats.set(**d)
+ d = dict()
+ if (timestamps[2] != 0):
+ d["deletionTime"] = datetime.fromtimestamp(timestamps[2]/1000000000)
+ d["mgmtQueueStats"] = queueStats
+ queue.set(**d)
+ print queue.id
+ result = queueStats
+ elif (objectName == "Vhost"):
+ print "* VHOST"
+ elif (objectName == "Broker"):
+ print "* BROKER"
+ print "END INST---------------------------------------------------\n"
+ return result
+
+ def methodCallback(self, broker, methodId, error, args):
+ print "\nMETHOD---------------------------------------------------"
+ print "broker=" + broker
+ print methodId
+ print error
+ print args
+ methodCallback = self.outstandingMethodCalls.pop(methodId)
+ print methodCallback
+ eval(methodCallback)
+ print "END METHOD---------------------------------------------------\n"
+
+ def addManagedBroker(self, broker, label):
+ broker.configListener(label, self.configCallback)
+ broker.instrumentationListener (label, self.instCallback)
+ broker.methodListener (label, self.methodCallback)
+
+ def registerCallback(self, callback):
+ self.currentMethodId += 1
+ methodId = self.currentMethodId
+ self.outstandingMethodCalls[methodId] = callback
+ return methodId
+
Modified: mgmt/mint/schemaparser.py
===================================================================
--- mgmt/mint/schemaparser.py 2007-11-12 21:55:30 UTC (rev 1290)
+++ mgmt/mint/schemaparser.py 2007-11-12 22:37:37 UTC (rev 1291)
@@ -1,4 +1,4 @@
-import qpid.mllib
+import mllib
from sqlobject import connectionForURI, sqlhub, MixedCaseUnderscoreStyle
@@ -26,9 +26,6 @@
self.dataTypesMap["bool"] = "BOOLEAN"
self.dataTypesMap["sstr"] = "VARCHAR(1000)"
self.dataTypesMap["lstr"] = "VARCHAR(4000)"
- #self.dataTypesMap["ipAddress"] = "VARCHAR(100)"
- #self.dataTypesMap["enum"] = "VARCHAR(100) CHECK ("
- #self.dataTypesMap["fieldTable"] = "VARCHAR(2000)"
def generate(self, name, elements, type):
self.startTable(name, type)
@@ -42,23 +39,23 @@
else:
actualName = name + "_stats"
self.currentTable = actualName
- self.sqlOutput += "\nCREATE TABLE " + actualName + " (\n"
+ self.sqlOutput += "\nCREATE TABLE %s (\n" % (actualName)
self.sqlOutput += " id BIGSERIAL PRIMARY KEY,\n"
self.sqlOutput += " id_original BIGINT,\n"
if (type == "config"):
- self.sqlOutput += " " + name + "_stats_id BIGINT,\n"
+ self.sqlOutput += " %s_stats_id BIGINT,\n" % (name)
else:
- self.sqlOutput += " " + name + "_id BIGINT REFERENCES " + name + " ,\n"
+ self.sqlOutput += " %s_id BIGINT REFERENCES %s ,\n" % (name, name)
self.generateTimestampColumn("rec")
if (type == "config"):
self.generateTimestampColumn("creation")
self.generateTimestampColumn("deletion")
def generateTimestampColumn(self, col):
- self.sqlOutput += " " + col + "_time TIMESTAMP,\n"
+ self.sqlOutput += " %s_time TIMESTAMP,\n" % (col)
def generateIndex(self, name):
- self.indexes += "\nCREATE INDEX " + self.currentTable + "_" + name + "_index ON " + self.currentTable + "(" + name + ");\n"
+ self.indexes += "\nCREATE INDEX %s_%s_index ON %s(%s);\n" % (self.currentTable, name, self.currentTable, name)
def generateColumn(self, elem, suffix=""):
actualName = self.style.pythonAttrToDBColumn(elem["@name"] + suffix)
@@ -76,9 +73,9 @@
params = ""
if (elem["@name"].endswith("Ref")):
foreignKeyTable = "mgmt_" + actualName.replace("_ref", "")
- self.sqlOutput += " " + foreignKeyTable + "_id BIGINT REFERENCES " + foreignKeyTable + ",\n"
+ self.sqlOutput += " %s_id BIGINT REFERENCES %s,\n" % (foreignKeyTable, foreignKeyTable)
else:
- self.sqlOutput += " " + actualName + " " + self.dataTypesMap[actualType] + params + ",\n"
+ self.sqlOutput += " %s %s %s,\n" % (actualName, self.dataTypesMap[actualType], params)
if (elem["@type"].startswith("hilo") and suffix == ""):
self.generateColumn(elem, "High")
self.generateColumn(elem, "Low")
@@ -88,7 +85,7 @@
def endTable(self, name, type):
self.sqlOutput = self.sqlOutput[:-2] + "\n);\n" + self.indexes
if (type == "inst"):
- self.sqlOutput += "\nALTER TABLE " + name + " ADD FOREIGN KEY (" + name + "_stats_id) REFERENCES " + name + "_stats;\n"
+ self.sqlOutput += "\nALTER TABLE %s ADD FOREIGN KEY (%s_stats_id) REFERENCES %s_stats;\n" % (name, name, name)
self.currentTable = ""
self.indexes = ""
@@ -105,9 +102,9 @@
syle = None
def __init__(self, style, dsn):
- self.pythonOutput = "from sqlobject import *\n\n" + \
- "conn = connectionForURI('" + dsn + "')\n" + \
- "sqlhub.processConnection = conn\n\n"
+ self.pythonOutput = "from sqlobject import *\n\n"
+ self.pythonOutput += "conn = connectionForURI(\"%s\")\n" % (dsn)
+ self.pythonOutput += "sqlhub.processConnection = conn\n\n"
self.additional = ""
self.style = style
@@ -116,14 +113,14 @@
name = prefix + name[0].upper() + name[1:]
return name
- def generate(self, name, elements):
- name = self.attrNameFromDbColumn(name)
- self.startClass(name + "Stats")
+ def generate(self, name, schemaName, schemaId, elements):
+ pythonName = self.attrNameFromDbColumn(name)
+ self.startClass(pythonName + "Stats")
self.endClass()
- self.startClass(name)
+ self.startClass(pythonName, schemaName, schemaId)
for elem in elements:
self.generateMethod(elem)
- self.endClass(name)
+ self.endClass(pythonName)
def generateAdditionalAttribs(self, name, elements):
name = self.attrNameFromDbColumn(name)
@@ -133,12 +130,15 @@
# generate foreign keys
refName = self.attrNameFromDbColumn(refName, "Mgmt", "Ref")
# add missing attribute (not added correctly with SqlObject 0.7.7; may need to be removed in later versions)
- self.pythonOutput += " _SO_class_" + self.style.pythonAttrToDBColumn(refName).capitalize() + " = " + refName + "()\n"
- self.additional += "\n" + refName + ".sqlmeta.addJoin(MultipleJoin('" + name + \
- "', joinMethodName='all" + name.replace("Mgmt", "") + "s'))"
+ self.pythonOutput += " _SO_class_%s = %s()\n" % (self.style.pythonAttrToDBColumn(refName).capitalize(), refName)
+ self.additional += "\n%s.sqlmeta.addJoin(MultipleJoin('%s" % (refName, name)
+ self.additional += "', joinMethodName='all%ss'))" % (name.replace("Mgmt", ""))
- def startClass(self, name):
- self.pythonOutput += "\nclass " + name + "(SQLObject):\n"
+ def startClass(self, pythonName, schemaName="", schemaId=""):
+ self.pythonOutput += "\nclass %s(SQLObject):\n" % (pythonName)
+ if (schemaName != ""):
+ self.pythonOutput += " schemaId = %d\n" % int(schemaId)
+ self.pythonOutput += " schemaName = \"%s\"\n" % schemaName
self.pythonOutput += " class sqlmeta:\n"
self.pythonOutput += " fromDatabase = True\n"
@@ -147,9 +147,11 @@
comment = ' """' + elem["@desc"] + '"""\n'
else:
comment = ""
- self.pythonOutput += " def " + elem["@name"] + "():\n"
+ self.pythonOutput += " def %s(self, managedBroker, model, callbackMethod):\n" % (elem["@name"])
self.pythonOutput += comment
- self.pythonOutput += " pass\n"
+ self.pythonOutput += " methodId = model.registerCallback(callbackMethod)\n"
+ self.pythonOutput += " managedBroker.method(self.schemaId, methodId, self.schemaName, \"%s\", packageName=\"qpid\", " % (elem["@name"])
+ self.pythonOutput += "args=())\n"
def endClass(self, name=""):
if (self.additional != ""):
@@ -157,7 +159,7 @@
self.additional = ""
if (name != "" and not name.endswith("Stats")):
# add missing attribute (not added correctly with SqlObject 0.7.7; may need to be removed in later versions)
- self.pythonOutput += " _SO_class_" + self.style.pythonAttrToDBColumn(name).capitalize() + "_stats = " + name + "Stats()\n"
+ self.pythonOutput += " _SO_class_%s_stats = %sStats()\n" % (self.style.pythonAttrToDBColumn(name).capitalize(), name)
def getCode(self):
return self.pythonOutput
@@ -180,7 +182,7 @@
self.sqlGen = SqlGenerator(self.style)
def parseConfigFile(self):
- config = qpid.mllib.xml_parse("config.xml")
+ config = mllib.xml_parse("config.xml")
configOptions = config.query["config/configOption"]
for opt in configOptions:
self.options[opt["@name"]] = opt["@value"]
@@ -190,13 +192,13 @@
sqlhub.processConnection = conn
sqlFile = open(self.options["sqlOutput"], "w")
pythonFile = open(self.options["pythonOutput"], "w")
- schema = qpid.mllib.xml_parse(self.options["schemaXML"])
+ schema = mllib.xml_parse(self.options["schemaXML"])
classes = schema.query["schema/class"]
for cls in classes:
actualName = "mgmt_" + cls["@name"]
self.sqlGen.generate(actualName, cls.query["configElement"], "config")
self.sqlGen.generate(actualName, cls.query["instElement"], "inst")
- self.pythonGen.generate(actualName, cls.query["method"])
+ self.pythonGen.generate(actualName, cls["@name"], cls["@schemaId"], cls.query["method"])
self.pythonGen.generateAdditionalAttribs(actualName, cls.query["configElement"])
sqlFile.write(self.sqlGen.getCode())
pythonFile.write(self.pythonGen.getCode())
17 years, 1 month
rhmessaging commits: r1290 - store/trunk/cpp/tests/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2007-11-12 16:55:30 -0500 (Mon, 12 Nov 2007)
New Revision: 1290
Modified:
store/trunk/cpp/tests/jrnl/msg_consumer.cpp
store/trunk/cpp/tests/jrnl/tests.ods
store/trunk/cpp/tests/jrnl/wtests.csv
Log:
Fixes to write pipeline performance test parameters
Modified: store/trunk/cpp/tests/jrnl/msg_consumer.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/msg_consumer.cpp 2007-11-12 18:51:01 UTC (rev 1289)
+++ store/trunk/cpp/tests/jrnl/msg_consumer.cpp 2007-11-12 21:55:30 UTC (rev 1290)
@@ -136,6 +136,7 @@
_tot_dblks += dtokp->dblocks_read();
_tot_dsize += data_size;
+#ifdef RHM_TIMERS
// Comment out these for performance checks/measurements
check_msg(msgCntr, data_size, min_msg_size, max_msg_size, !external_flag,
datap);
@@ -143,6 +144,7 @@
check_transience(msgCntr, transient_flag, transient_expected);
check_external(msgCntr, external_flag, external_expected);
//print_dbug(msgCntr, data_size, _msg_buff, true);
+#endif
break;
case rhm::journal::RHM_IORES_AIO_WAIT:
//std::cout << "a" << std::flush;
Modified: store/trunk/cpp/tests/jrnl/tests.ods
===================================================================
(Binary files differ)
Modified: store/trunk/cpp/tests/jrnl/wtests.csv
===================================================================
--- store/trunk/cpp/tests/jrnl/wtests.csv 2007-11-12 18:51:01 UTC (rev 1289)
+++ store/trunk/cpp/tests/jrnl/wtests.csv 2007-11-12 21:55:30 UTC (rev 1290)
@@ -21,22 +21,22 @@
14,"L",1,10,0,10,0,10,10,10,10,TRUE,FALSE,FALSE,64,1,54,1,46,1,"10 * 10-byte message [deq txn]"
15,"L",1,1,0,1,0,10,10,10,10,TRUE,TRUE,FALSE,64,1,54,1,46,1,"1 * 10-byte message [txn deq transient]"
16,"L",1,10,0,10,0,10,10,10,10,TRUE,TRUE,FALSE,64,1,54,1,46,1,"10 * 10-byte message [txn deq transient]"
-17,"L",1,1,0,1,0,10,10,0,0,FALSE,FALSE,TRUE,54,1,0,0,0,0,"1 * 10-byte message [extern]"
-18,"L",1,10,0,10,0,10,10,0,0,FALSE,FALSE,TRUE,54,1,0,0,0,0,"10 * 10-byte message [extern]"
-19,"L",1,1,0,1,0,10,10,0,0,FALSE,TRUE,TRUE,54,1,0,0,0,0,"1 * 10-byte message [transient extern]"
-20,"L",1,10,0,10,0,10,10,0,0,FALSE,TRUE,TRUE,54,1,0,0,0,0,"10 * 10-byte message [transient extern]"
-21,"L",1,1,0,1,0,10,10,10,10,FALSE,FALSE,TRUE,64,1,0,0,0,0,"1 * 10-byte message [txn extern]"
-22,"L",1,10,0,10,0,10,10,10,10,FALSE,FALSE,TRUE,64,1,0,0,0,0,"10 * 10-byte message [txn extern]"
-23,"L",1,1,0,1,0,10,10,10,10,FALSE,TRUE,TRUE,64,1,0,0,0,0,"1 * 10-byte message [txn transient extern]"
-24,"L",1,10,0,10,0,10,10,10,10,FALSE,TRUE,TRUE,64,1,0,0,0,0,"10 * 10-byte message [txn transient extern]"
-25,"L",1,1,0,1,0,10,10,0,0,TRUE,FALSE,TRUE,54,1,32,1,0,0,"1 * 10-byte message [deq extern]"
-26,"L",1,10,0,10,0,10,10,0,0,TRUE,FALSE,TRUE,54,1,32,1,0,0,"10 * 10-byte message [deq extern]"
-27,"L",1,1,0,1,0,10,10,0,0,TRUE,TRUE,TRUE,54,1,32,1,0,0,"1 * 10-byte message [deq transient extern]"
-28,"L",1,10,0,10,0,10,10,0,0,TRUE,TRUE,TRUE,54,1,32,1,0,0,"10 * 10-byte message [deq transient extern]"
-29,"L",1,1,0,1,0,10,10,10,10,TRUE,FALSE,TRUE,64,1,54,1,46,1,"1 * 10-byte message [deq txn extern]"
-30,"L",1,10,0,10,0,10,10,10,10,TRUE,FALSE,TRUE,64,1,54,1,46,1,"10 * 10-byte message [deq txn extern]"
-31,"L",1,1,0,1,0,10,10,10,10,TRUE,TRUE,TRUE,64,1,54,1,46,1,"1 * 10-byte message [txn deq transient extern]"
-32,"L",1,10,0,10,0,10,10,10,10,TRUE,TRUE,TRUE,64,1,54,1,46,1,"10 * 10-byte message [txn deq transient extern]"
+17,"L",1,1,0,1,0,10,10,0,0,FALSE,FALSE,TRUE,44,1,0,0,0,0,"1 * 10-byte message [extern]"
+18,"L",1,10,0,10,0,10,10,0,0,FALSE,FALSE,TRUE,44,1,0,0,0,0,"10 * 10-byte message [extern]"
+19,"L",1,1,0,1,0,10,10,0,0,FALSE,TRUE,TRUE,44,1,0,0,0,0,"1 * 10-byte message [transient extern]"
+20,"L",1,10,0,10,0,10,10,0,0,FALSE,TRUE,TRUE,44,1,0,0,0,0,"10 * 10-byte message [transient extern]"
+21,"L",1,1,0,1,0,10,10,10,10,FALSE,FALSE,TRUE,54,1,0,0,0,0,"1 * 10-byte message [txn extern]"
+22,"L",1,10,0,10,0,10,10,10,10,FALSE,FALSE,TRUE,54,1,0,0,0,0,"10 * 10-byte message [txn extern]"
+23,"L",1,1,0,1,0,10,10,10,10,FALSE,TRUE,TRUE,54,1,0,0,0,0,"1 * 10-byte message [txn transient extern]"
+24,"L",1,10,0,10,0,10,10,10,10,FALSE,TRUE,TRUE,54,1,0,0,0,0,"10 * 10-byte message [txn transient extern]"
+25,"L",1,1,0,1,0,10,10,0,0,TRUE,FALSE,TRUE,44,1,32,1,0,0,"1 * 10-byte message [deq extern]"
+26,"L",1,10,0,10,0,10,10,0,0,TRUE,FALSE,TRUE,44,1,32,1,0,0,"10 * 10-byte message [deq extern]"
+27,"L",1,1,0,1,0,10,10,0,0,TRUE,TRUE,TRUE,44,1,32,1,0,0,"1 * 10-byte message [deq transient extern]"
+28,"L",1,10,0,10,0,10,10,0,0,TRUE,TRUE,TRUE,44,1,32,1,0,0,"10 * 10-byte message [deq transient extern]"
+29,"L",1,1,0,1,0,10,10,10,10,TRUE,FALSE,TRUE,54,1,54,1,46,1,"1 * 10-byte message [deq txn extern]"
+30,"L",1,10,0,10,0,10,10,10,10,TRUE,FALSE,TRUE,54,1,54,1,46,1,"10 * 10-byte message [deq txn extern]"
+31,"L",1,1,0,1,0,10,10,10,10,TRUE,TRUE,TRUE,54,1,54,1,46,1,"1 * 10-byte message [txn deq transient extern]"
+32,"L",1,10,0,10,0,10,10,10,10,TRUE,TRUE,TRUE,54,1,54,1,46,1,"10 * 10-byte message [txn deq transient extern]"
,,,,,,,,,,,,,,,,,,,,
"Transition from one d-block to two per message",,,,,,,,,,,,,,,,,,,,
33,"L",1,10,0,10,0,84,84,0,0,FALSE,FALSE,FALSE,128,1,0,0,0,0,"1 dblk exact fit"
@@ -288,6 +288,6 @@
,,,,,,,,,,,,,,,,,,,,
"STANDARD PERFORMANCE BENCHMARK: 10,000,000 writes, data=212b (2 dblks)",,,,,,,,,,,,,,,,,,,,
263,"M",1,10000000,0,10000000,0,212,212,0,0,FALSE,FALSE,FALSE,256,2,0,0,0,0,"212 bytes data (2 dblks enq)"
-264,"M",1,10000000,0,10000000,0,404,404,64,64,FALSE,FALSE,FALSE,512,4,0,0,0,0,"212 bytes data + 64 bytes xid (3 dblks enq)"
+264,"M",1,10000000,0,10000000,0,148,148,64,64,FALSE,FALSE,FALSE,256,2,0,0,0,0,"148 bytes data + 64 bytes xid (2 dblks enq)"
265,"M",1,10000000,0,10000000,0,212,212,0,0,TRUE,FALSE,FALSE,256,2,32,1,0,0,"212 bytes data (2 dblks enq + 1 dblk deq)"
-266,"M",1,10000000,0,10000000,0,404,404,64,64,TRUE,FALSE,FALSE,512,4,108,1,100,1,"212 bytes data + 64 bytes xid (3 dblks enq + 1 dblks deq + 1 dblks txn)"
+266,"M",1,10000000,0,10000000,0,148,148,64,64,TRUE,FALSE,FALSE,256,2,108,1,100,1,"148 bytes data + 64 bytes xid (2 dblks enq + 1 dblks deq + 1 dblks txn)"
17 years, 1 month
rhmessaging commits: r1289 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-12 13:51:01 -0500 (Mon, 12 Nov 2007)
New Revision: 1289
Modified:
mgmt/cumin/python/cumin/page.strings
mgmt/cumin/python/cumin/queue.strings
Log:
Makes queue charts refresh.
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-11-12 16:55:45 UTC (rev 1288)
+++ mgmt/cumin/python/cumin/page.strings 2007-11-12 18:51:01 UTC (rev 1289)
@@ -584,6 +584,17 @@
status.elem("div").set(errors + ", " + warnings);
}
+counter = 0;
+
+function updateImage(id, object) {
+ var img = wooly.doc().elembyid(id);
+
+ src = img.getattr("src");
+ sep = src.lastIndexOf(";");
+
+ img.setattr("src", src + ";");
+}
+
[CuminPage.html]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-12 16:55:45 UTC (rev 1288)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-12 18:51:01 UTC (rev 1289)
@@ -258,19 +258,25 @@
[StatisticsHistory.html]
<h2>Depth</h2>
<div class="iblock chart">
- <img src="{depth_chart_url}"/>
+ <img id="{id}.depth" src="{depth_chart_url}"/>
</div>
<h2>Consumers</h2>
<div class="iblock chart">
- <img src="{consumers_chart_url}"/>
+ <img id="{id}.consumers" src="{consumers_chart_url}"/>
</div>
<h2>Transactions</h2>
<div class="iblock chart">
- <img src="{transactions_chart_url}"/>
+ <img id="{id}.transactions" src="{transactions_chart_url}"/>
</div>
+<script>
+ cumin.queue.listeners["{id}.depth"] = updateImage
+ cumin.queue.listeners["{id}.consumers"] = updateImage
+ cumin.queue.listeners["{id}.transactions"] = updateImage
+</script>
+
[QueueConsumerSet.html]
<div class="sactions">
<h2>Act on Selected Consumers:</h2>
17 years, 1 month
rhmessaging commits: r1288 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-12 11:55:45 -0500 (Mon, 12 Nov 2007)
New Revision: 1288
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.strings
Log:
Ajaxifies current stats of clients and exchanges.
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-11-12 16:43:01 UTC (rev 1287)
+++ mgmt/cumin/python/cumin/client.py 2007-11-12 16:55:45 UTC (rev 1288)
@@ -67,9 +67,6 @@
return "Client %s" % client.address
class ClientStatus(CuminStatus):
- def render_data_url(self, session, client):
- return "client.xml?id=%i" % client.id
-
def render_messages_produced(self, session, client):
value = client.get_measurement("msgsProduced").get_rate()
return fmt_rate(value, "msg", "sec")
@@ -107,6 +104,9 @@
def get_title(self, session, client):
return "Client '%s'" % client.address
+ def render_data_url(self, session, client):
+ return "client.xml?id=%i" % client.id
+
def render_address(self, session, client):
return client.address
@@ -133,7 +133,7 @@
def __init__(self, app, name):
super(ClientStatistics.StatisticsCurrent, self).__init__(app, name)
- self.add_child(MeasurementSet(app, "general_stats", "general"))
+ self.add_child(MeasurementSet(app, "general", "general"))
def get_title(self, session, client):
return "Current"
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-11-12 16:43:01 UTC (rev 1287)
+++ mgmt/cumin/python/cumin/client.strings 2007-11-12 16:55:45 UTC (rev 1288)
@@ -33,10 +33,10 @@
</tr>
[ClientStatus.javascript]
-function updateClientStatus(id, data) {
- updateStatus(id, data);
+function updateClientStatus(id, client) {
+ updateStatus(id, client);
- var m = data.root().object().measurement;
+ var m = client.measurement;
var mdata = {
"tr": [
null,
@@ -73,10 +73,23 @@
</table>
</div>
<script>
- wooly.setIntervalUpdate("{id}", "{data_url}", updateClientStatus, 3000);
+ cumin.client.listeners["{id}"] = updateClientStatus, 3000;
</script>
+[ClientView.javascript]
+function updateClient(data) {
+ var client = data.root().object();
+
+ for (var id in cumin.client.listeners) {
+ cumin.client.listeners[id](id, client);
+ }
+}
+
[ClientView.html]
+<script>
+ wooly.setIntervalUpdate("{data_url}", updateClient, 3000);
+</script>
+
{status}
<h1>{title}</h1>
@@ -106,12 +119,15 @@
<tr>
<td class="twocol">
<h2>General</h2>
- {general_stats}
+ {general}
</td>
<td class="twocol">
</td>
</tr>
</table>
+<script>
+ cumin.client.listeners["{id}.general"] = updateMeasurements;
+</script>
[StatisticsHistory.html]
<h2>Produced</h2>
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-11-12 16:43:01 UTC (rev 1287)
+++ mgmt/cumin/python/cumin/exchange.py 2007-11-12 16:55:45 UTC (rev 1288)
@@ -168,6 +168,9 @@
def get_title(self, session, exchange):
return "Exchange '%s'" % exchange.name
+ def render_data_url(self, session, exchange):
+ return "exchange.xml?id=%i" % exchange.id
+
def render_name(self, session, exchange):
return exchange.name
@@ -343,7 +346,7 @@
def __init__(self, app, name):
super(ExchangeStatistics.StatisticsCurrent, self).__init__(app, name)
- self.add_child(MeasurementSet(app, "general_stats", "general"))
+ self.add_child(MeasurementSet(app, "general", "general"))
def get_title(self, session, exchange):
return "Current"
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2007-11-12 16:43:01 UTC (rev 1287)
+++ mgmt/cumin/python/cumin/exchange.strings 2007-11-12 16:55:45 UTC (rev 1288)
@@ -84,10 +84,10 @@
</script>
[ExchangeStatus.javascript]
-function updateExchangeStatus(id, data) {
- updateStatus(id, data);
+function updateExchangeStatus(id, exchange) {
+ updateStatus(id, exchange);
- var m = data.root().object().measurement;
+ var m = exchange.measurement;
var mdata = {
"tr": [
null,
@@ -130,10 +130,23 @@
</table>
</div>
<script>
- wooly.setIntervalUpdate("{id}", "{data_url}", updateExchangeStatus, 3000);
+ cumin.exchange.listeners["{id}"] = updateExchangeStatus
</script>
+[ExchangeView.javascript]
+function updateExchange(data) {
+ var exchange = data.root().object();
+
+ for (var id in cumin.exchange.listeners) {
+ cumin.exchange.listeners[id](id, exchange);
+ }
+}
+
[ExchangeView.html]
+<script>
+ wooly.setIntervalUpdate("{data_url}", updateExchange, 3000);
+</script>
+
{status}
<h1><img src="resource?name=exchange-36.png"> {title}</h1>
@@ -175,12 +188,15 @@
<tr>
<td class="twocol">
<h2>General</h2>
- {general_stats}
+ {general}
</td>
<td class="twocol">
</td>
</tr>
</table>
+<script>
+ cumin.exchange.listeners["{id}.general"] = updateMeasurements;
+</script>
[StatisticsHistory.html]
<h2>Received</h2>
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-11-12 16:43:01 UTC (rev 1287)
+++ mgmt/cumin/python/cumin/page.strings 2007-11-12 16:55:45 UTC (rev 1288)
@@ -554,8 +554,13 @@
function Cumin() {
this.queue = new Object();
- this.queue.latest = new Object();
- this.queue.listeners = new Array();
+ this.queue.listeners = new Object();
+
+ this.exchange = new Object();
+ this.exchange.listeners = new Object();
+
+ this.client = new Object();
+ this.client.listeners = new Object();
}
}())
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-12 16:43:01 UTC (rev 1287)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-12 16:55:45 UTC (rev 1288)
@@ -148,8 +148,6 @@
function updateQueue(data) {
var queue = data.root().object();
- //wooly.dir(cumin.queue.listeners);
-
for (var id in cumin.queue.listeners) {
cumin.queue.listeners[id](id, queue);
}
17 years, 1 month