rhmessaging commits: r2357 - mgmt/trunk/cumin/bin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-08-26 09:40:49 -0400 (Tue, 26 Aug 2008)
New Revision: 2357
Modified:
mgmt/trunk/cumin/bin/cumin-bench
Log:
Add a calibration step to the cumin-bench profiling mode
Modified: mgmt/trunk/cumin/bin/cumin-bench
===================================================================
--- mgmt/trunk/cumin/bin/cumin-bench 2008-08-26 12:34:43 UTC (rev 2356)
+++ mgmt/trunk/cumin/bin/cumin-bench 2008-08-26 13:40:49 UTC (rev 2357)
@@ -69,6 +69,19 @@
prof = Profile()
+ print "Calibrating"
+
+ biases = list()
+
+ for i in range(5):
+ bias = prof.calibrate(100000)
+ biases.append(bias)
+ print i, bias
+
+ prof.bias = sum(biases) / float(5)
+
+ print "Using bias %f" % prof.bias
+
try:
statement = "do_main('%s', '%s', '%s', %i, %r)" % \
(home, data, spec, hits, check_xml)
15 years, 9 months
rhmessaging commits: r2356 - mgmt/trunk/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-26 08:34:43 -0400 (Tue, 26 Aug 2008)
New Revision: 2356
Modified:
mgmt/trunk/cumin/python/wooly/tables.py
Log:
Removed code to render inline sort arrow images. It was replaced with background images in css to avoid column resizing after a sort.
Modified: mgmt/trunk/cumin/python/wooly/tables.py
===================================================================
--- mgmt/trunk/cumin/python/wooly/tables.py 2008-08-25 22:18:14 UTC (rev 2355)
+++ mgmt/trunk/cumin/python/wooly/tables.py 2008-08-26 12:34:43 UTC (rev 2356)
@@ -171,18 +171,6 @@
else:
return "unsorted_down"
-
- def render_sort_arrow(self, session, *args):
- sel = self.parent.get_selected_column(session)
-
- if sel is self.column:
- if self.parent.reversed.get(session):
- return "<img src=\"resource?name=sort-arrow-up.png\" alt=\"sort ascending\" />"
- else:
- return "<img src=\"resource?name=sort-arrow-down.png\" alt=\"sort descending\" />"
- else:
- return "<img src=\"resource?name=x.png\" width=\"9\" height=\"10\" alt=\"\" />"
-
class SqlTable(ItemTable):
def __init__(self, app, name):
super(SqlTable, self).__init__(app, name)
15 years, 9 months
rhmessaging commits: r2355 - mgmt/trunk/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-25 18:18:14 -0400 (Mon, 25 Aug 2008)
New Revision: 2355
Modified:
mgmt/trunk/cumin/python/wooly/tables.py
mgmt/trunk/cumin/python/wooly/tables.strings
Log:
Added :hover style on table column headers to indicate that clicking on the column header will sort the list.
Modified: mgmt/trunk/cumin/python/wooly/tables.py
===================================================================
--- mgmt/trunk/cumin/python/wooly/tables.py 2008-08-25 19:11:27 UTC (rev 2354)
+++ mgmt/trunk/cumin/python/wooly/tables.py 2008-08-25 22:18:14 UTC (rev 2355)
@@ -158,14 +158,30 @@
def render_class_attr(self, session, *args):
return self.column.get_class_attr(session)
+ def render_sorted_dir(self, session, *args):
+ sel = self.parent.get_selected_column(session)
+
+ if sel is self.column:
+ if self.parent.reversed.get(session):
+ return "up"
+ else:
+ return "down"
+ elif self.parent.reversed.get(session):
+ return "unsorted_up"
+ else:
+ return "unsorted_down"
+
+
def render_sort_arrow(self, session, *args):
sel = self.parent.get_selected_column(session)
if sel is self.column:
if self.parent.reversed.get(session):
- return "<img src=\"resource?name=sort-arrow-up.png\" />"
+ return "<img src=\"resource?name=sort-arrow-up.png\" alt=\"sort ascending\" />"
else:
- return "<img src=\"resource?name=sort-arrow-down.png\" />"
+ return "<img src=\"resource?name=sort-arrow-down.png\" alt=\"sort descending\" />"
+ else:
+ return "<img src=\"resource?name=x.png\" width=\"9\" height=\"10\" alt=\"\" />"
class SqlTable(ItemTable):
def __init__(self, app, name):
Modified: mgmt/trunk/cumin/python/wooly/tables.strings
===================================================================
--- mgmt/trunk/cumin/python/wooly/tables.strings 2008-08-25 19:11:27 UTC (rev 2354)
+++ mgmt/trunk/cumin/python/wooly/tables.strings 2008-08-25 22:18:14 UTC (rev 2355)
@@ -7,5 +7,37 @@
[ItemTable.item_html]
<tr>{cells}</tr>
+[ItemTableColumnHeader.css]
+a.ItemTableColumnHeader span{
+ border:1px solid transparent;
+ padding: 2px 14px 2px 4px;
+}
+a.ItemTableColumnHeader span:hover {
+ border:1px solid #EAEAEA;
+ background-color: #FFFFFF;
+ background-repeat: no-repeat;
+ background-position: right 5px;
+}
+a.ItemTableColumnHeader span.unsorted_down:hover {
+ background-image: url(resource?name=sort-arrow-down.png);
+ background-repeat: no-repeat;
+ background-position: right 5px;
+}
+a.ItemTableColumnHeader span.unsorted_up:hover {
+ background-image: url(resource?name=sort-arrow-up.png);
+ background-repeat: no-repeat;
+ background-position: right 5px;
+}
+a.ItemTableColumnHeader span.up {
+ background-image: url(resource?name=sort-arrow-up.png);
+ background-repeat: no-repeat;
+ background-position: right 5px;
+}
+a.ItemTableColumnHeader span.down {
+ background-image: url(resource?name=sort-arrow-down.png);
+ background-repeat: no-repeat;
+ background-position: right 5px;
+}
+
[ItemTableColumnHeader.html]
-<th {class_attr}><a href="{href}">{content} {sort_arrow}</a></th>
+<th {class_attr}><a class="ItemTableColumnHeader" href="{href}"><span class="{sorted_dir}">{content}</span></a></th>
15 years, 9 months
rhmessaging commits: r2354 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-25 15:11:27 -0400 (Mon, 25 Aug 2008)
New Revision: 2354
Modified:
mgmt/trunk/cumin/python/cumin/brokerlink.py
mgmt/trunk/cumin/python/cumin/brokerlink.strings
Log:
On the view broker link page, make the status box red when there is a non-null last error
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-08-25 18:29:45 UTC (rev 2353)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-08-25 19:11:27 UTC (rev 2354)
@@ -268,24 +268,16 @@
return "No, Cancel"
class PeerStatus(CuminStatus):
- def render_messages_received(self, session, peer):
- return self.app.model.exchange.msgReceives.rate_html(peer)
+
+ def render_color(self, session, link):
+ return link.statsCurr.lastError and "red" or "green"
+
+ def render_peer_state(self, session, peer):
+ return peer.statsCurr.state
- def render_messages_routed(self, session, peer):
- return self.app.model.exchange.msgRoutes.rate_html(peer)
+ def render_peer_error(self, session, peer):
+ return peer.statsCurr.lastError
- def render_messages_dropped(self, session, peer):
- return self.app.model.exchange.msgDrops.value(peer)
-
- def render_bytes_received(self, session, peer):
- return self.app.model.exchange.byteReceives.rate_html(peer)
-
- def render_bytes_routed(self, session, peer):
- return self.app.model.exchange.byteRoutes.rate_html(peer)
-
- def render_bytes_dropped(self, session, peer):
- return self.app.model.exchange.byteDrops.value(peer)
-
class PeerView(CuminView):
def __init__(self, app, name):
super(PeerView, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.strings 2008-08-25 18:29:45 UTC (rev 2353)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.strings 2008-08-25 19:11:27 UTC (rev 2354)
@@ -312,3 +312,18 @@
}
]]>
</script>
+
+
+[PeerStatus.html]
+<div id="{id}" class="CuminStatus {color}">
+ <table>
+ <tr>
+ <th><strong>State</strong></th>
+ <td>{peer_state}</td>
+ </tr>
+ <tr>
+ <th><strong>Last Error</strong></th>
+ <td>{peer_error}</td>
+ </tr>
+ </table>
+</div>
15 years, 9 months
rhmessaging commits: r2353 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-25 14:29:45 -0400 (Mon, 25 Aug 2008)
New Revision: 2353
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
Really make "transient" the default value for the SavedParameter (used for adding broker links)
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-08-25 18:27:29 UTC (rev 2352)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-08-25 18:29:45 UTC (rev 2353)
@@ -736,12 +736,12 @@
super(SavedField, self).__init__(app, name, form)
param = Parameter(app, "param")
- param.default = "saved"
+ param.default = "notsaved"
self.add_parameter(param)
self.set_parameter(param)
option = self.Saved(app, "saved", form)
- option.set_value(param.default)
+ option.set_value("saved")
self.add_option(option)
option = self.NotSaved(app, "notsaved", form)
15 years, 9 months
rhmessaging commits: r2352 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-25 14:27:29 -0400 (Mon, 25 Aug 2008)
New Revision: 2352
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
Add new SaveParameter type for adding broker links
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-08-25 18:26:57 UTC (rev 2351)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-08-25 18:27:29 UTC (rev 2352)
@@ -731,6 +731,40 @@
def render_title(self, session):
return "Transient"
+class SavedField(RadioField):
+ def __init__(self, app, name, form):
+ super(SavedField, self).__init__(app, name, form)
+
+ param = Parameter(app, "param")
+ param.default = "saved"
+ self.add_parameter(param)
+ self.set_parameter(param)
+
+ option = self.Saved(app, "saved", form)
+ option.set_value(param.default)
+ self.add_option(option)
+
+ option = self.NotSaved(app, "notsaved", form)
+ option.set_value("notsaved")
+ self.add_option(option)
+
+ def render_title(self, session):
+ return "Restore if broker restarts?"
+
+ class Saved(RadioFieldOption):
+ def render_value(self, session):
+ return "saved"
+
+ def render_title(self, session):
+ return "Yes, restore if broker restarts"
+
+ class NotSaved(RadioFieldOption):
+ def render_value(self, session):
+ return "notsaved"
+
+ def render_title(self, session):
+ return "No, do not restore if broker restarts"
+
class ExclusivityField(RadioField):
def __init__(self, app, name, form):
super(ExclusivityField, self).__init__(app, name, form)
15 years, 9 months
rhmessaging commits: r2351 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-25 14:26:57 -0400 (Mon, 25 Aug 2008)
New Revision: 2351
Modified:
mgmt/trunk/cumin/python/cumin/brokerlink.py
mgmt/trunk/cumin/python/cumin/brokerlink.strings
Log:
Make "transient" the default for adding links
Change wording for durable/transient to "Save/Don't Save" when adding links.
Add help to "Add Route" for tag and exclude
Make tag and exclude fields hidden by default and give them default values.
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-08-25 15:35:39 UTC (rev 2350)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-08-25 18:26:57 UTC (rev 2351)
@@ -428,16 +428,41 @@
self.excludes.set_title("Excludes")
self.add_field(self.excludes)
+ self.tag_excludes = list()
+ self.tag_excludes.append(self.tag)
+ self.tag_excludes.append(self.excludes)
def get_args(self, session):
return self.frame.get_args(session)
+ def render_fields(self, session, *args):
+ writer = Writer()
+
+ for field in self.fields:
+ if not field in self.tag_excludes:
+ writer.write(field.render(session))
+
+ return writer.to_string()
+
+ def render_hidden_fields(self, session, *args):
+ writer = Writer()
+
+ for field in self.tag_excludes:
+ writer.write(field.render(session))
+
+ return writer.to_string()
+
def render_title(self, session, link):
return "Add Route to '%s:%d'" % (link.host, link.port)
def pre_process(self, session, *args):
self.exchange.pre_process(session, *args)
+ if not self.tag.get(session):
+ self.tag.set(session, args[0].managedBroker)
+ if not self.excludes.get(session):
+ self.excludes.set(session, "%s:%s" % (args[0].host, args[0].port))
+
def process_cancel(self, session, *args):
self.key.set(session, "")
self.tag.set(session, "")
@@ -458,7 +483,7 @@
excludes = self.excludes.get(session)
exchange_id = self.exchange.get(session)
exchange = Exchange.get(int(exchange_id))
- durable = exchange.durable
+ durable = link.durable
args = {"durable": durable,
"exchange": exchange.name,
@@ -481,7 +506,7 @@
self.add_parameter(self.host)
self.add_form_parameter(self.host)
- self.durable = DurabilityField(app, "durable", self)
+ self.durable = SavedField(app, "saved", self)
self.add_field(self.durable)
self.errors = dict()
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.strings 2008-08-25 15:35:39 UTC (rev 2350)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.strings 2008-08-25 18:26:57 UTC (rev 2351)
@@ -228,3 +228,87 @@
[PeerRouteSetClose.item_html]
<tr>{item_content}</tr>
+[BridgeAdd.css]
+div#BridgeAdd div#more_button {
+ border:1px solid #333333;
+ background-color: #EEEEEE;
+ color: #333333;
+ cursor: pointer;
+ float:left; /* shrink to fit */
+ margin: 0 0 1em 2em;
+ padding: 4px 8px;
+}
+
+div#BridgeAdd div#hidden_fields {
+ margin-left: 2em;
+ display: none;
+}
+
+div#BridgeAdd div.clear_left {
+ clear:left;
+ font-size:0;
+ line-height:0;
+}
+
+div#BridgeAdd div.hidden_help {
+ color:#333333;
+ margin-right:1em;
+}
+div#BridgeAdd span.tag1 {
+ color:red;
+}
+div#BridgeAdd span.tag2 {
+ color:green;
+}
+
+[BridgeAdd.html]
+<div id="BridgeAdd">
+<form id="{id}" class="mform" method="post" action="?">
+ <div class="head">{title}</div>
+ <div class="body">{fields}</div>
+
+ <div id="more_button">Show More Options...</div>
+ <div class="clear_left"><!-- --></div>
+ <div id="hidden_fields">
+ <div class="hidden_help">
+ <p>The <strong>Tag</strong> and <strong>Excludes</strong> are used to prevent a message from routing back
+ to the source broker and causing an infinite loop.</p>
+ <p>Enter a short <strong>tag</strong> that will be associated with the source exchange.
+ Then <strong>exclude</strong> any tags that were used for the destination exchanges.</p>
+ <p class="example">
+ <em>broker1</em> <==> <em>broker2</em> tag: <span class="tag2">tag2</span> excludes: <span class="tag1">tag1</span><br/>
+ <em>broker2</em> <==> <em>broker1</em> tag: <span class="tag1">tag1</span> excludes: <span class="tag2">tag2</span>
+ </p>
+ </div>
+ {hidden_fields}
+ </div>
+ {form_error}
+ <div class="foot">
+ {help}
+ {submit}
+ {cancel}
+ </div>
+ <div>{hidden_inputs}</div>
+</form>
+</div>
+<script type="text/javascript">
+<![CDATA[
+ wooly.doc().elembyid("{id}").node.elements[0].focus();
+ document.getElementById("more_button").onclick = click_more;
+ function click_more() {
+ var hfields = document.getElementById("hidden_fields");
+ if (hfields) {
+ if (hfields.style.display == "block") {
+ hfields.style.display = "none";
+ this.innerHTML = "Show More Options...";
+ document.getElementById("{more_path}").value = "f";
+ }
+ else {
+ hfields.style.display = "block";
+ this.innerHTML = "Hide Options";
+ document.getElementById("{more_path}").value = "t";
+ }
+ }
+ }
+]]>
+</script>
15 years, 9 months
rhmessaging commits: r2350 - mgmt/trunk/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-08-25 11:35:39 -0400 (Mon, 25 Aug 2008)
New Revision: 2350
Modified:
mgmt/trunk/cumin/python/wooly/devel.py
Log:
Now unused
Modified: mgmt/trunk/cumin/python/wooly/devel.py
===================================================================
--- mgmt/trunk/cumin/python/wooly/devel.py 2008-08-22 14:18:33 UTC (rev 2349)
+++ mgmt/trunk/cumin/python/wooly/devel.py 2008-08-25 15:35:39 UTC (rev 2350)
@@ -10,9 +10,6 @@
self.app = app
self.check_xml = check_xml
- if check_xml:
- self.parser = ParserCreate()
-
def run(self, max=-1):
visited = set()
self.app.debug.urls.add("")
15 years, 9 months
rhmessaging commits: r2349 - mgmt/trunk/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-22 10:18:33 -0400 (Fri, 22 Aug 2008)
New Revision: 2349
Modified:
mgmt/trunk/cumin/python/wooly/widgets.py
Log:
Fixed bug in paginator where the current page could be greater than the max number of pages.
Fixed bug in generating next/previous pageset links where the page number was not being updated.
Modified: mgmt/trunk/cumin/python/wooly/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/wooly/widgets.py 2008-08-22 12:26:48 UTC (rev 2348)
+++ mgmt/trunk/cumin/python/wooly/widgets.py 2008-08-22 14:18:33 UTC (rev 2349)
@@ -282,6 +282,20 @@
return self.pageset_size * pageset, self.pageset_size * (pageset + 1)
def set_count(self, session, count):
+ page_index = self.page_index.get(session)
+ pageset_index = self.pageset_index.get(session)
+ count_per_pageset = self.page_size * self.pageset_size
+
+ # is the count too low to be on the current pageset
+ if count < count_per_pageset * pageset_index:
+ self.pageset_index.set(session, 0)
+ self.page_index.set(session, 0)
+
+ # is the count too low to be on the current page
+ elif count < page_index * self.page_size:
+ self.pageset_index.set(session, 0)
+ self.page_index.set(session, 0)
+
return self.page_count.set(session, count)
def get_count(self, session):
@@ -341,8 +355,10 @@
if pageset < 1:
html = self.__link(session.marshal(), "<<", "pagenav disabled")
else:
+ page_index = self.page_index.get(session)
branch = session.branch()
self.pageset_index.set(branch, pageset - 1)
+ self.page_index.set(branch, page_index - self.pageset_size)
html = self.__link(branch.marshal(), "<<", "pagenav")
return html
@@ -355,6 +371,11 @@
else:
branch = session.branch()
self.pageset_index.set(branch, pageset + 1)
+ new_page_index = self.page_index.get(branch) + self.pageset_size
+ max_page_count = self.get_page_count(branch)
+ if new_page_index >= max_page_count:
+ new_page_index = max_page_count - 1
+ self.page_index.set(branch, new_page_index)
html = self.__link(branch.marshal(), ">>", "pagenav")
return html
15 years, 9 months
rhmessaging commits: r2348 - store/branches/mrg-1.0/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-08-22 08:26:48 -0400 (Fri, 22 Aug 2008)
New Revision: 2348
Modified:
store/branches/mrg-1.0/cpp/lib/jrnl/jcntl.cpp
Log:
Fixed a 64-32bit conversion error introduced in the last checkin
Modified: store/branches/mrg-1.0/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/branches/mrg-1.0/cpp/lib/jrnl/jcntl.cpp 2008-08-22 12:26:24 UTC (rev 2347)
+++ store/branches/mrg-1.0/cpp/lib/jrnl/jcntl.cpp 2008-08-22 12:26:48 UTC (rev 2348)
@@ -43,6 +43,7 @@
#include "jrnl/jerrno.hpp"
#include "jrnl/jinf.hpp"
#include "jrnl/slock.hpp"
+#include <limits>
#include <sstream>
#include <unistd.h>
@@ -868,7 +869,7 @@
if (ifsp->eof() || !ifsp->good())
{
rd._eo = ifsp->tellg(); // remember file offset before closing
- assert(rd._eo != 0xffffffffffffffff); // Check for error code -1
+ assert(rd._eo != std::numeric_limits<std::size_t>::max()); // Check for error code -1
ifsp->close();
if (++fid >= _num_jfiles)
{
15 years, 9 months