rhmessaging commits: r1148 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-23 14:31:45 -0400 (Tue, 23 Oct 2007)
New Revision: 1148
Modified:
mgmt/cumin/python/cumin/demo.py
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/exchange.strings
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.strings
mgmt/notes/Todo
Log:
Adds producers.
Modified: mgmt/cumin/python/cumin/demo.py
===================================================================
--- mgmt/cumin/python/cumin/demo.py 2007-10-23 18:04:51 UTC (rev 1147)
+++ mgmt/cumin/python/cumin/demo.py 2007-10-23 18:31:45 UTC (rev 1148)
@@ -139,6 +139,11 @@
exchange.name = name
vhost.add_exchange(exchange)
+ for producer_count in range(10):
+ producer = Producer(self.model)
+ producer.name = fmt("producer", producer_count)
+ exchange.add_producer(producer)
+
for queue_count in range(10):
queue = Queue(self.model)
queue.name = fmt("queue", queue_count)
@@ -200,6 +205,14 @@
self.frob_measure(measure)
finally:
binding.unlock()
+
+ for producer in exchange.producer_items():
+ producer.lock()
+ try:
+ for measure in producer.measurements:
+ self.frob_measure(measure)
+ finally:
+ producer.unlock()
for queue in vhost.queue_items():
queue.lock()
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-10-23 18:04:51 UTC (rev 1147)
+++ mgmt/cumin/python/cumin/exchange.py 2007-10-23 18:31:45 UTC (rev 1148)
@@ -87,9 +87,9 @@
self.tabs = TabSet(app, "tabs")
self.add_child(self.tabs)
+ self.tabs.add_tab(ProducerSet(app, "producers"))
self.tabs.add_tab(ExchangeBindingSet(app, "bindings"))
self.tabs.add_tab(ExchangeStatistics(app, "stats"))
- self.tabs.add_tab(self.ExchangeProducers(app, "producers"))
def render_title(self, session, exchange):
return "Exchange '%s'" % exchange.name
@@ -275,3 +275,19 @@
class StatisticsHistory(Widget):
def render_title(self, session, exchange):
return "History"
+
+class ProducerSet(ItemSet):
+ def render_title(self, session, queue):
+ return "Producers (%i)" % len(queue.producer_items())
+
+ def get_items(self, session, queue):
+ return sorted_by(queue.producer_items())
+
+ def render_item_name(self, session, producer):
+ return producer.name
+
+ def render_item_messages_produced(self, session, producer):
+ return producer.get_measurement("msgsProduced").get_value()
+
+ def render_item_bytes_produced(self, session, producer):
+ return producer.get_measurement("bytesProduced").get_value()
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2007-10-23 18:04:51 UTC (rev 1147)
+++ mgmt/cumin/python/cumin/exchange.strings 2007-10-23 18:31:45 UTC (rev 1148)
@@ -132,3 +132,32 @@
</td>
</tr>
</table>
+
+[ProducerSet.html]
+<select>
+ <option>Act on Selection...</option>
+ <option>Throttle Producers</option>
+ <option>Start Producers</option>
+ <option>Stop Producers</option>
+</select>
+
+<br/><br/>
+
+<table class="mobjects">
+ <tr>
+ <th><input type="checkbox"/></th>
+ <th>Producer</th>
+ <th style="text-align: right;">Msgs. Produced</th>
+ <th style="text-align: right;">Bytes Produced</th>
+ </tr>
+
+ {items}
+</table>
+
+[ProducerSet.item_html]
+<tr>
+ <td><input type="checkbox"/></td>
+ <td>{item_name}</td>
+ <td style="text-align: right;">{item_messages_produced}</td>
+ <td style="text-align: right;">{item_bytes_produced}</td>
+</tr>
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-10-23 18:04:51 UTC (rev 1147)
+++ mgmt/cumin/python/cumin/model.py 2007-10-23 18:31:45 UTC (rev 1148)
@@ -16,6 +16,7 @@
self.queue = ModelClass(self, "queue")
self.consumer = ModelClass(self, "consumer")
self.exchange = ModelClass(self, "exchange")
+ self.producer = ModelClass(self, "producer")
self.client = ModelClass(self, "client")
self.session = ModelClass(self, "session")
self.realm = ModelClass(self, "realm")
@@ -78,6 +79,10 @@
assoc.add_endpoint(self.virtual_host, "exchange", "0..n")
assoc.add_endpoint(self.exchange, "virtual_host", "0..1")
+ assoc = ModelAssociation(self, "exchange_to_producers")
+ assoc.add_endpoint(self.exchange, "producer", "0..n")
+ assoc.add_endpoint(self.producer, "exchange", "0..1")
+
assoc = ModelAssociation(self, "virtual_host_to_clients")
assoc.add_endpoint(self.virtual_host, "client", "0..n")
assoc.add_endpoint(self.client, "virtual_host", "0..1")
@@ -635,6 +640,22 @@
writer.write("</exchange>")
+class Producer(MeasuredModelObject):
+ def __init__(self, model):
+ super(Producer, self).__init__(model, model.producer)
+
+ self.name = None
+
+ measure = Measurement("msgsProduced", "int")
+ measure.title = "Messages produced"
+ measure.categories = ("message", "general")
+ self.measurements.append(measure)
+
+ measure = Measurement("bytesProduced", "int")
+ measure.title = "Bytes produced"
+ measure.categories = ("byte", "general")
+ self.measurements.append(measure)
+
class Binding(ModelObject):
def __init__(self, model):
super(Binding, self).__init__(model, model.binding)
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-10-23 18:04:51 UTC (rev 1147)
+++ mgmt/cumin/python/cumin/queue.strings 2007-10-23 18:31:45 UTC (rev 1148)
@@ -211,8 +211,8 @@
<select>
<option>Act on Selection...</option>
<option>Throttle Consumers</option>
+ <option>Start Consumers</option>
<option>Stop Consumers</option>
- <option>Start Consumers</option>
<option>Close Consumers</option>
</select>
@@ -224,7 +224,7 @@
<th>Consumer</th>
<th style="text-align: right;">Msgs. Consumed</th>
<th style="text-align: right;">Bytes Consumed</th>
- <th style="text-align: right;">Msgs. Unacknowledged</th>
+ <th style="text-align: right;">Msgs. Unacked</th>
</tr>
{items}
Modified: mgmt/notes/Todo
===================================================================
--- mgmt/notes/Todo 2007-10-23 18:04:51 UTC (rev 1147)
+++ mgmt/notes/Todo 2007-10-23 18:31:45 UTC (rev 1148)
@@ -112,3 +112,7 @@
* Rename routing_key to binding_key
* Remove legacy show_view methods now that we have set_view_mode
+
+ * Make the model objects use MeasuredModelObject
+
+ * Add more bindings to the demo data
17 years, 4 months
rhmessaging commits: r1147 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-23 14:04:51 -0400 (Tue, 23 Oct 2007)
New Revision: 1147
Modified:
mgmt/cumin/python/cumin/demo.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
Log:
Adds consumers to the model and demo data and displays them under
queue.
Modified: mgmt/cumin/python/cumin/demo.py
===================================================================
--- mgmt/cumin/python/cumin/demo.py 2007-10-23 17:33:50 UTC (rev 1146)
+++ mgmt/cumin/python/cumin/demo.py 2007-10-23 18:04:51 UTC (rev 1147)
@@ -144,6 +144,11 @@
queue.name = fmt("queue", queue_count)
vhost.add_queue(queue)
+ for consumer_count in range(10):
+ consumer = Consumer(self.model)
+ consumer.name = fmt("consumer", consumer_count)
+ queue.add_consumer(consumer)
+
for num in range(100, 200, 10):
client = Client(self.model)
client.address = "192.168.0.%i:16565" % num
@@ -212,6 +217,14 @@
finally:
queue.unlock()
+ for consumer in queue.consumer_items():
+ consumer.lock()
+ try:
+ for measure in consumer.measurements:
+ self.frob_measure(measure)
+ finally:
+ consumer.unlock()
+
for client in vhost.client_items():
client.lock()
try:
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-10-23 17:33:50 UTC (rev 1146)
+++ mgmt/cumin/python/cumin/model.py 2007-10-23 18:04:51 UTC (rev 1147)
@@ -14,6 +14,7 @@
self.virtual_host = ModelClass(self, "virtual_host")
self.virtual_host_group = ModelClass(self, "virtual_host_group")
self.queue = ModelClass(self, "queue")
+ self.consumer = ModelClass(self, "consumer")
self.exchange = ModelClass(self, "exchange")
self.client = ModelClass(self, "client")
self.session = ModelClass(self, "session")
@@ -69,6 +70,10 @@
assoc.add_endpoint(self.virtual_host, "queue", "0..n")
assoc.add_endpoint(self.queue, "virtual_host", "0..1")
+ assoc = ModelAssociation(self, "queue_to_consumers")
+ assoc.add_endpoint(self.queue, "consumer", "0..n")
+ assoc.add_endpoint(self.consumer, "queue", "0..1")
+
assoc = ModelAssociation(self, "virtual_host_to_exchanges")
assoc.add_endpoint(self.virtual_host, "exchange", "0..n")
assoc.add_endpoint(self.exchange, "virtual_host", "0..1")
@@ -523,6 +528,39 @@
writer.write("</queue>")
+class MeasuredModelObject(ModelObject):
+ def __init__(self, model, mclass):
+ super(MeasuredModelObject, self).__init__(model, mclass)
+
+ self.measurements = list()
+
+ def get_measurement(self, name):
+ for measure in self.measurements:
+ if measure.name == name:
+ return measure
+
+class Consumer(MeasuredModelObject):
+ def __init__(self, model):
+ super(Consumer, self).__init__(model, model.consumer)
+
+ self.name = None
+
+ measure = Measurement("msgsConsumed", "int")
+ measure.title = "Messages Consumed"
+ measure.categories = ("message", "general")
+ self.measurements.append(measure)
+
+ measure = Measurement("bytesConsumed", "int")
+ measure.title = "Bytes Consumed"
+ measure.categories = ("byte", "general")
+ self.measurements.append(measure)
+
+ measure = Measurement("unackedMessages", "int")
+ measure.title = "Unacknowledged messages"
+ measure.categories = ("message", "general")
+ measure.highlow = True
+ self.measurements.append(measure)
+
class Exchange(ModelObject):
def __init__(self, model):
super(Exchange, self).__init__(model, model.exchange)
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-10-23 17:33:50 UTC (rev 1146)
+++ mgmt/cumin/python/cumin/queue.py 2007-10-23 18:04:51 UTC (rev 1147)
@@ -114,9 +114,9 @@
self.tabs = TabSet(app, "tabs")
self.add_child(self.tabs)
+ self.tabs.add_tab(ConsumerSet(app, "consumers"))
self.tabs.add_tab(QueueBindingSet(app, "bindings"))
self.tabs.add_tab(QueueStatistics(app, "stats"))
- self.tabs.add_tab(self.QueueConsumers(app, "consumers"))
def render_title(self, session, queue):
return "Queue '%s'" % queue.name
@@ -134,10 +134,6 @@
else:
raise Exception()
- class QueueConsumers(Widget):
- def render_title(self, session, queue):
- return "Consumers"
-
class QueueBindingSet(ItemSet):
def render_title(self, session, queue):
return "Bindings (%i)" % len(queue.binding_items())
@@ -382,3 +378,22 @@
class StatisticsHistory(Widget):
def render_title(self, session, queue):
return "History"
+
+class ConsumerSet(ItemSet):
+ def render_title(self, session, queue):
+ return "Consumers (%i)" % len(queue.consumer_items())
+
+ def get_items(self, session, queue):
+ return sorted_by(queue.consumer_items())
+
+ def render_item_name(self, session, consumer):
+ return consumer.name
+
+ def render_item_messages_consumed(self, session, consumer):
+ return consumer.get_measurement("msgsConsumed").get_value()
+
+ def render_item_bytes_consumed(self, session, consumer):
+ return consumer.get_measurement("bytesConsumed").get_value()
+
+ def render_item_unacked_messages(self, session, consumer):
+ return consumer.get_measurement("unackedMessages").get_value()
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-10-23 17:33:50 UTC (rev 1146)
+++ mgmt/cumin/python/cumin/queue.strings 2007-10-23 18:04:51 UTC (rev 1147)
@@ -206,3 +206,35 @@
</td>
</tr>
</table>
+
+[ConsumerSet.html]
+<select>
+ <option>Act on Selection...</option>
+ <option>Throttle Consumers</option>
+ <option>Stop Consumers</option>
+ <option>Start Consumers</option>
+ <option>Close Consumers</option>
+</select>
+
+<br/><br/>
+
+<table class="mobjects">
+ <tr>
+ <th><input type="checkbox"/></th>
+ <th>Consumer</th>
+ <th style="text-align: right;">Msgs. Consumed</th>
+ <th style="text-align: right;">Bytes Consumed</th>
+ <th style="text-align: right;">Msgs. Unacknowledged</th>
+ </tr>
+
+ {items}
+</table>
+
+[ConsumerSet.item_html]
+<tr>
+ <td><input type="checkbox"/></td>
+ <td>{item_name}</td>
+ <td style="text-align: right;">{item_messages_consumed}</td>
+ <td style="text-align: right;">{item_bytes_consumed}</td>
+ <td style="text-align: right;">{item_unacked_messages}</td>
+</tr>
17 years, 4 months
rhmessaging commits: r1146 - in mgmt/cumin/python: wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-23 13:33:50 -0400 (Tue, 23 Oct 2007)
New Revision: 1146
Modified:
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/client.strings
mgmt/cumin/python/cumin/demo.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/python/cumin/server.strings
mgmt/cumin/python/wooly/__init__.py
Log:
Fills out the client UI. Adds sessions to the model and demo data.
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-10-23 15:53:46 UTC (rev 1145)
+++ mgmt/cumin/python/cumin/client.py 2007-10-23 17:33:50 UTC (rev 1146)
@@ -56,8 +56,7 @@
self.tabs = TabSet(app, "tabs")
self.add_child(self.tabs)
- self.tabs.add_tab(ClientSessionSet(app, "bindings"))
- self.tabs.add_tab(ClientStatistics(app, "stats"))
+ self.tabs.add_tab(SessionSet(app, "bindings"))
def render_title(self, session, client):
return "Client '%s'" % client.address
@@ -65,10 +64,22 @@
def render_client_address(self, session, client):
return client.address
-class ClientSessionSet(Widget):
+class SessionSet(ItemSet):
def render_title(self, session, client):
- return "Sessions"
+ return "Sessions (%i)" % len(client.session_items())
-class ClientStatistics(Widget):
- def render_title(self, session, client):
- return "Statistics"
+ def get_items(self, session, client):
+ return sorted_by(client.session_items())
+
+ def render_item_name(self, session, session_):
+ return session_.name
+
+ def render_item_status(self, session, session_):
+ result = session_.get_measurement("attached").get_value()
+ return result and "Attached" or "Detached"
+
+ def render_item_remaining_lifespan(self, session, session_):
+ return session_.get_measurement("remainingLifespan").get_value()
+
+ def render_item_frames_outstanding(self, session, session_):
+ return session_.get_measurement("framesOutstanding").get_value()
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-10-23 15:53:46 UTC (rev 1145)
+++ mgmt/cumin/python/cumin/client.strings 2007-10-23 17:33:50 UTC (rev 1146)
@@ -1,10 +1,7 @@
[ClientSet.html]
<form>
- <select>
- <option>Act on Selection...</option>
- <option>Close Client</option>
- <option>Detach Client</option>
- </select>
+ <button>Close Clients</button>
+ <button>Detach Clients</button>
<br/><br/>
@@ -56,3 +53,35 @@
{tabs}
</div>
+
+[SessionSet.html]
+<select>
+ <option>Act on Selection...</option>
+ <option>Solicit Acknowledgment</option>
+ <option>Reset Lifespan</option>
+ <option>Detach Sessions</option>
+ <option>Close Sessions</option>
+</select>
+
+<br/><br/>
+
+<table class="mobjects">
+ <tr>
+ <th><input type="checkbox"/></th>
+ <th>Session</th>
+ <th>Status</th>
+ <th style="text-align: right;">Remaining Lifespan</th>
+ <th style="text-align: right;">Frames Outstanding</th>
+ </tr>
+
+ {items}
+</table>
+
+[SessionSet.item_html]
+<tr>
+ <td><input type="checkbox"/></td>
+ <td>{item_name}</td>
+ <td>{item_status}</td>
+ <td style="text-align: right;">{item_remaining_lifespan}</td>
+ <td style="text-align: right;">{item_frames_outstanding}</td>
+</tr>
Modified: mgmt/cumin/python/cumin/demo.py
===================================================================
--- mgmt/cumin/python/cumin/demo.py 2007-10-23 15:53:46 UTC (rev 1145)
+++ mgmt/cumin/python/cumin/demo.py 2007-10-23 17:33:50 UTC (rev 1146)
@@ -149,6 +149,11 @@
client.address = "192.168.0.%i:16565" % num
vhost.add_client(client)
+ for session_count in range(10):
+ session = Session(self.model)
+ session.name = fmt("session", session_count)
+ client.add_session(session)
+
def start_updates(self):
thread = UpdateThread(self.model)
thread.start()
@@ -214,6 +219,14 @@
self.frob_measure(measure)
finally:
client.unlock()
+
+ for session in client.session_items():
+ session.lock()
+ try:
+ for measure in session.measurements:
+ self.frob_measure(measure)
+ finally:
+ session.unlock()
if __name__ == "__main__":
import sys
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-10-23 15:53:46 UTC (rev 1145)
+++ mgmt/cumin/python/cumin/model.py 2007-10-23 17:33:50 UTC (rev 1146)
@@ -16,6 +16,7 @@
self.queue = ModelClass(self, "queue")
self.exchange = ModelClass(self, "exchange")
self.client = ModelClass(self, "client")
+ self.session = ModelClass(self, "session")
self.realm = ModelClass(self, "realm")
self.binding = ModelClass(self, "binding")
@@ -76,6 +77,10 @@
assoc.add_endpoint(self.virtual_host, "client", "0..n")
assoc.add_endpoint(self.client, "virtual_host", "0..1")
+ assoc = ModelAssociation(self, "client_to_sessions")
+ assoc.add_endpoint(self.client, "session", "0..n")
+ assoc.add_endpoint(self.session, "client", "0..1")
+
assoc = ModelAssociation(self, "virtual_host_to_realms")
assoc.add_endpoint(self.virtual_host, "realm", "0..n")
assoc.add_endpoint(self.realm, "virtual_host", "0..1")
@@ -154,6 +159,9 @@
def get_client(self, id):
return self.get_index(self.client).get(id)
+ def get_session(self, id):
+ return self.get_index(self.session).get(id)
+
def get_realm(self, id):
return self.get_index(self.realm).get(id)
@@ -647,3 +655,30 @@
if measure.name == name:
return measure
+class Session(ModelObject):
+ def __init__(self, model):
+ super(Session, self).__init__(model, model.session)
+
+ self.name = None
+
+ self.measurements = list()
+
+ measure = Measurement("attached", "bool")
+ measure.title = "Attached"
+ measure.categories = ("general")
+ self.measurements.append(measure)
+
+ measure = Measurement("remainingLifespan", "int")
+ measure.title = "Remaining lifespan"
+ measure.categories = ("general")
+ self.measurements.append(measure)
+
+ measure = Measurement("framesOutstanding", "int")
+ measure.title = "Frames outstanding"
+ measure.categories = ("general")
+ self.measurements.append(measure)
+
+ def get_measurement(self, name):
+ for measure in self.measurements:
+ if measure.name == name:
+ return measure
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-10-23 15:53:46 UTC (rev 1145)
+++ mgmt/cumin/python/cumin/queue.strings 2007-10-23 17:33:50 UTC (rev 1146)
@@ -6,11 +6,8 @@
}
[QueueSet.html]
-<form>
- <select>
- <option>Act on Selection...</option>
- <option>Purge Messages</option>
- </select>
+<form action="{href}" method="get">
+ <button type="submit">Purge Messages</button>
<br/><br/>
Modified: mgmt/cumin/python/cumin/server.strings
===================================================================
--- mgmt/cumin/python/cumin/server.strings 2007-10-23 15:53:46 UTC (rev 1145)
+++ mgmt/cumin/python/cumin/server.strings 2007-10-23 17:33:50 UTC (rev 1146)
@@ -39,7 +39,7 @@
<table class="mobjects">
<tr>
- <th></th>
+ <th><input type="checkbox"/></th>
<th>Server</th>
<th>Profile</th>
<th>Cluster</th>
Modified: mgmt/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/cumin/python/wooly/__init__.py 2007-10-23 15:53:46 UTC (rev 1145)
+++ mgmt/cumin/python/wooly/__init__.py 2007-10-23 17:33:50 UTC (rev 1146)
@@ -155,7 +155,7 @@
return None
def render_href(self, session, object):
- return None
+ return session.marshal()
def render_title(self, session, object):
return None
17 years, 4 months
rhmessaging commits: r1145 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-23 11:53:46 -0400 (Tue, 23 Oct 2007)
New Revision: 1145
Modified:
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/page.strings
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
Log:
Adds empty tabs for producers and consumers. Adds a status box to the
main view.
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-10-23 15:35:09 UTC (rev 1144)
+++ mgmt/cumin/python/cumin/exchange.py 2007-10-23 15:53:46 UTC (rev 1145)
@@ -89,6 +89,7 @@
self.tabs.add_tab(ExchangeBindingSet(app, "bindings"))
self.tabs.add_tab(ExchangeStatistics(app, "stats"))
+ self.tabs.add_tab(self.ExchangeProducers(app, "producers"))
def render_title(self, session, exchange):
return "Exchange '%s'" % exchange.name
@@ -106,6 +107,10 @@
else:
raise Exception()
+ class ExchangeProducers(Widget):
+ def render_title(self, session, queue):
+ return "Producers"
+
class ExchangeBindingSet(ItemSet):
def render_title(self, session, exchange):
return "Bindings (%i)" % len(exchange.binding_items())
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-10-23 15:35:09 UTC (rev 1144)
+++ mgmt/cumin/python/cumin/page.strings 2007-10-23 15:53:46 UTC (rev 1145)
@@ -443,8 +443,14 @@
[MainView.html]
<div class="oblock">
+ <div class="mstatus green" id="{id}">
+ <div>0 errors, 0 warnings</div>
+ </div>
+
<h1>{title}</h1>
+ <br/>
+
<ul class="TabSet tabs">{tabs}</ul>
<div class="TabSet mode">{mode}</div>
</div>
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-10-23 15:35:09 UTC (rev 1144)
+++ mgmt/cumin/python/cumin/queue.py 2007-10-23 15:53:46 UTC (rev 1145)
@@ -116,6 +116,7 @@
self.tabs.add_tab(QueueBindingSet(app, "bindings"))
self.tabs.add_tab(QueueStatistics(app, "stats"))
+ self.tabs.add_tab(self.QueueConsumers(app, "consumers"))
def render_title(self, session, queue):
return "Queue '%s'" % queue.name
@@ -133,6 +134,10 @@
else:
raise Exception()
+ class QueueConsumers(Widget):
+ def render_title(self, session, queue):
+ return "Consumers"
+
class QueueBindingSet(ItemSet):
def render_title(self, session, queue):
return "Bindings (%i)" % len(queue.binding_items())
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-10-23 15:35:09 UTC (rev 1144)
+++ mgmt/cumin/python/cumin/queue.strings 2007-10-23 15:53:46 UTC (rev 1145)
@@ -131,6 +131,10 @@
<dt>Latency Tuning</dt><dd>{latency_tuning}</dd>
</dl>
+ <ul class="actions">
+ <li><a href="">Purge Messages</a></li>
+ </ul>
+
{tabs}
</div>
17 years, 4 months
rhmessaging commits: r1144 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-23 11:35:09 -0400 (Tue, 23 Oct 2007)
New Revision: 1144
Modified:
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/client.strings
mgmt/cumin/python/cumin/page.py
mgmt/cumin/python/cumin/parameters.py
mgmt/cumin/python/cumin/virtualhost.py
mgmt/notes/Todo
Log:
Adds a distinct view for client.
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-10-23 15:01:37 UTC (rev 1143)
+++ mgmt/cumin/python/cumin/client.py 2007-10-23 15:35:09 UTC (rev 1144)
@@ -14,11 +14,14 @@
def get_items(self, session, vhost):
return sorted_by(vhost.client_items(), "address")
- def render_item_address(self, session, client):
- #branch = session.branch()
- #return mlink(branch.marshal(), "Client", client.address)
- return client.address
+ 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)
+ def render_item_sessions(self, session, client):
+ return "10 sessions"
+
def render_item_messages_produced(self, session, client):
return client.get_measurement("msgsProduced").get_value()
@@ -30,3 +33,42 @@
def render_item_bytes_consumed(self, session, client):
return client.get_measurement("bytesConsumed").get_value()
+
+class ClientFrame(CuminFrame):
+ def __init__(self, app, name):
+ super(ClientFrame, self).__init__(app, name)
+
+ self.param = ClientParameter(app, "id")
+ self.add_parameter(self.param)
+ self.set_object_parameter(self.param)
+
+ self.view = ClientView(app, "view")
+ self.add_mode(self.view)
+ self.set_view_mode(self.view)
+
+ def render_title(self, session, client):
+ return "Client %s" % client.address
+
+class ClientView(Widget):
+ def __init__(self, app, name):
+ super(ClientView, self).__init__(app, name)
+
+ self.tabs = TabSet(app, "tabs")
+ self.add_child(self.tabs)
+
+ self.tabs.add_tab(ClientSessionSet(app, "bindings"))
+ self.tabs.add_tab(ClientStatistics(app, "stats"))
+
+ def render_title(self, session, client):
+ return "Client '%s'" % client.address
+
+ def render_client_address(self, session, client):
+ return client.address
+
+class ClientSessionSet(Widget):
+ def render_title(self, session, client):
+ return "Sessions"
+
+class ClientStatistics(Widget):
+ def render_title(self, session, client):
+ return "Statistics"
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-10-23 15:01:37 UTC (rev 1143)
+++ mgmt/cumin/python/cumin/client.strings 2007-10-23 15:35:09 UTC (rev 1144)
@@ -26,10 +26,33 @@
[ClientSet.item_html]
<tr>
<td><input type="checkbox"/></td>
- <td>{item_address}</td>
- <td>Active</td>
+ <td>{item_link}</td>
+ <td>{item_sessions}</td>
<td style="text-align: right;">{item_messages_produced}</td>
<td style="text-align: right;">{item_messages_consumed}</td>
<td style="text-align: right;">{item_bytes_produced}</td>
<td style="text-align: right;">{item_bytes_consumed}</td>
</tr>
+
+[ClientView.html]
+<div class="oblock">
+ <div class="mstatus green" id="{id}">
+ <h2>Client Status</h2>
+
+ <div>0 errors, 0 warnings</div>
+ </div>
+
+ <h1>{title}</h1>
+
+ <dl class="properties">
+ <dt>Address</dt><dd>{client_address}</dd>
+ <dt>Authentication ID</dt><dd>e50e7dcaa8d6a039a</dd>
+ </dl>
+
+ <ul class="actions">
+ <li><a href="">Close This Client</a></li>
+ <li><a href="">Detach This Client</a></li>
+ </ul>
+
+ {tabs}
+</div>
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2007-10-23 15:01:37 UTC (rev 1143)
+++ mgmt/cumin/python/cumin/page.py 2007-10-23 15:35:09 UTC (rev 1144)
@@ -121,6 +121,11 @@
frame = frame.show_exchange(session, exchange)
return self.set_current_frame(session, frame)
+ def show_client(self, session, client):
+ frame = self.show_virtual_host(session, client.virtual_host)
+ frame = frame.show_client(session, client)
+ return self.set_current_frame(session, frame)
+
def server_group_href(self, session, group):
branch = session.branch()
self.show_server_group(branch, group).show_view(branch)
Modified: mgmt/cumin/python/cumin/parameters.py
===================================================================
--- mgmt/cumin/python/cumin/parameters.py 2007-10-23 15:01:37 UTC (rev 1143)
+++ mgmt/cumin/python/cumin/parameters.py 2007-10-23 15:35:09 UTC (rev 1144)
@@ -1,5 +1,12 @@
from wooly import *
+class ClientParameter(Parameter):
+ def do_unmarshal(self, string):
+ return self.app.model.get_client(int(string))
+
+ def do_marshal(self, client):
+ return str(client.id)
+
class ClusterParameter(Parameter):
def do_unmarshal(self, string):
return self.app.model.get_cluster(int(string))
Modified: mgmt/cumin/python/cumin/virtualhost.py
===================================================================
--- mgmt/cumin/python/cumin/virtualhost.py 2007-10-23 15:01:37 UTC (rev 1143)
+++ mgmt/cumin/python/cumin/virtualhost.py 2007-10-23 15:35:09 UTC (rev 1144)
@@ -37,6 +37,9 @@
self.exchange = ExchangeFrame(app, "exchange")
self.add_mode(self.exchange)
+ self.client = ClientFrame(app, "client")
+ self.add_mode(self.client)
+
self.view = VirtualHostView(app, "view")
self.add_mode(self.view)
@@ -51,6 +54,10 @@
self.exchange.set_object(session, exchange)
return self.show_mode(session, self.exchange)
+ def show_client(self, session, client):
+ self.client.set_object(session, client)
+ return self.show_mode(session, self.client)
+
def render_title(self, session, vhost):
return "Functional Host '%s'" % vhost.name
Modified: mgmt/notes/Todo
===================================================================
--- mgmt/notes/Todo 2007-10-23 15:01:37 UTC (rev 1143)
+++ mgmt/notes/Todo 2007-10-23 15:35:09 UTC (rev 1144)
@@ -110,3 +110,5 @@
registered sets of widgets and parameters
* Rename routing_key to binding_key
+
+ * Remove legacy show_view methods now that we have set_view_mode
17 years, 4 months
rhmessaging commits: r1143 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-23 11:01:37 -0400 (Tue, 23 Oct 2007)
New Revision: 1143
Modified:
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/exchange.strings
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/python/cumin/util.py
mgmt/notes/Todo
Log:
Adds more stats to aggreg views of queues and exchanges. Sketches in
actions.
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-10-23 14:19:24 UTC (rev 1142)
+++ mgmt/cumin/python/cumin/exchange.py 2007-10-23 15:01:37 UTC (rev 1143)
@@ -51,6 +51,18 @@
def render_item_status(self, session, exchange):
return "2 errors"
+ def render_item_messages_received(self, session, exchange):
+ return exchange.get_measurement("msgReceives").get_value()
+
+ def render_item_bytes_received(self, session, exchange):
+ return exchange.get_measurement("byteReceives").get_value()
+
+ def render_item_messages_routed(self, session, exchange):
+ return exchange.get_measurement("msgRoutes").get_value()
+
+ def render_item_bytes_routed(self, session, exchange):
+ return exchange.get_measurement("byteRoutes").get_value()
+
class ExchangeFrame(CuminFrame):
def __init__(self, app, name):
super(ExchangeFrame, self).__init__(app, name)
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2007-10-23 14:19:24 UTC (rev 1142)
+++ mgmt/cumin/python/cumin/exchange.strings 2007-10-23 15:01:37 UTC (rev 1143)
@@ -17,6 +17,10 @@
<th>Exchange</th>
<th>Configuration</th>
<th>Status</th>
+ <th style="text-align: right;">Msgs. Received</th>
+ <th style="text-align: right;">Bytes Received</th>
+ <th style="text-align: right;">Msgs. Routed</th>
+ <th style="text-align: right;">Bytes Routed</th>
</tr>
{items}
@@ -27,6 +31,10 @@
<td>{item_link}</a></td>
<td>{item_config}</td>
<td>{item_status}</td>
+ <td style="text-align: right;">{item_messages_received}</td>
+ <td style="text-align: right;">{item_bytes_received}</td>
+ <td style="text-align: right;">{item_messages_routed}</td>
+ <td style="text-align: right;">{item_bytes_routed}</td>
</tr>
[ExchangeForm.html]
@@ -95,7 +103,7 @@
<table class="ExchangeBindingSet mobjects">
<tr>
<th>Queue</th>
- <th>Routing Key</th>
+ <th>Key</th>
<th style="text-align: right;">Messages Matched</th>
</tr>
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-10-23 14:19:24 UTC (rev 1142)
+++ mgmt/cumin/python/cumin/queue.py 2007-10-23 15:01:37 UTC (rev 1143)
@@ -47,12 +47,22 @@
def render_item_config(self, session, queue):
count = len(queue.binding_items())
- return "%i %s" % (count, count == 1 and "binding" or "bindings")
+ return "%i binding%s" % (count, ess(count))
def render_item_status(self, session, queue):
- return "%i messages in queue<br/>%i errors, %i warnings" \
- % (queue.message_count, queue.error_count, queue.warning_count)
+ return "%i error%s, %i warning%s" \
+ % (queue.error_count, ess(queue.error_count),
+ queue.warning_count, ess(queue.warning_count))
+ def render_item_message_depth(self, session, queue):
+ return queue.get_measurement("msgDepth").get_value()
+
+ def render_item_byte_depth(self, session, queue):
+ return queue.get_measurement("byteDepth").get_value()
+
+ def render_item_consumers(self, session, queue):
+ return queue.get_measurement("consumers").get_value()
+
class QueueFrame(CuminFrame):
def __init__(self, app, name):
super(QueueFrame, self).__init__(app, name)
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-10-23 14:19:24 UTC (rev 1142)
+++ mgmt/cumin/python/cumin/queue.strings 2007-10-23 15:01:37 UTC (rev 1143)
@@ -6,21 +6,38 @@
}
[QueueSet.html]
-<table class="QueueSet mobjects">
- <tr>
- <th>Queue</th>
- <th>Configuration</th>
- <th>Status</th>
- </tr>
+<form>
+ <select>
+ <option>Act on Selection...</option>
+ <option>Purge Messages</option>
+ </select>
- {items}
-</table>
+ <br/><br/>
+ <table class="QueueSet mobjects">
+ <tr>
+ <th><input type="checkbox"/></th>
+ <th>Queue</th>
+ <th>Configuration</th>
+ <th>Status</th>
+ <th style="text-align: right;">Msg. Depth</th>
+ <th style="text-align: right;">Byte Depth</th>
+ <th style="text-align: right;">Consumers</th>
+ </tr>
+
+ {items}
+ </table>
+</form>
+
[QueueSet.item_html]
<tr>
+ <td><input type="checkbox"/></td>
<td>{item_link}</a></td>
<td>{item_config}</td>
<td>{item_status}</td>
+ <td style="text-align: right;">{item_message_depth}</td>
+ <td style="text-align: right;">{item_byte_depth}</td>
+ <td style="text-align: right;">{item_consumers}</td>
</tr>
[QueueForm.html]
@@ -121,7 +138,7 @@
<table class="QueueBindingSet mobjects">
<tr>
<th>Exchange</th>
- <th>Routing Key</th>
+ <th>Key</th>
<th style="text-align: right;">Messages Matched</th>
</tr>
Modified: mgmt/cumin/python/cumin/util.py
===================================================================
--- mgmt/cumin/python/cumin/util.py 2007-10-23 14:19:24 UTC (rev 1142)
+++ mgmt/cumin/python/cumin/util.py 2007-10-23 15:01:37 UTC (rev 1143)
@@ -1,2 +1,5 @@
def sorted_by(seq, attr="name"):
return sorted(seq, cmp, lambda x: getattr(x, attr))
+
+def ess(num, ending="s"):
+ return num != 1 and ending or ""
Modified: mgmt/notes/Todo
===================================================================
--- mgmt/notes/Todo 2007-10-23 14:19:24 UTC (rev 1142)
+++ mgmt/notes/Todo 2007-10-23 15:01:37 UTC (rev 1143)
@@ -108,3 +108,5 @@
* Add a sanity check traversal to the widget tree and to the
registered sets of widgets and parameters
+
+ * Rename routing_key to binding_key
17 years, 4 months
rhmessaging commits: r1142 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-23 10:19:24 -0400 (Tue, 23 Oct 2007)
New Revision: 1142
Modified:
mgmt/cumin/python/cumin/client.strings
mgmt/cumin/python/cumin/virtualhost.strings
Log:
Alignment changes to the clients table. Adds a placeholder status
block to vhost.
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-10-23 12:55:04 UTC (rev 1141)
+++ mgmt/cumin/python/cumin/client.strings 2007-10-23 14:19:24 UTC (rev 1142)
@@ -6,18 +6,17 @@
<option>Detach Client</option>
</select>
- <input type="Submit" value="Submit">
-
<br/><br/>
<table class="mobjects">
<tr>
<th><input type="checkbox"/></th>
<th>Client</th>
- <th>Messages Produced</th>
- <th>Bytes Produced</th>
- <th>Messages Consumed</th>
- <th>Bytes Consumed</th>
+ <th>Status</th>
+ <th style="text-align: right;">Msgs. Produced</th>
+ <th style="text-align: right;">Bytes Produced</th>
+ <th style="text-align: right;">Msgs. Consumed</th>
+ <th style="text-align: right;">Bytes Consumed</th>
</tr>
{items}
@@ -28,8 +27,9 @@
<tr>
<td><input type="checkbox"/></td>
<td>{item_address}</td>
- <td>{item_messages_produced}</td>
- <td>{item_messages_consumed}</td>
- <td>{item_bytes_produced}</td>
- <td>{item_bytes_consumed}</td>
+ <td>Active</td>
+ <td style="text-align: right;">{item_messages_produced}</td>
+ <td style="text-align: right;">{item_messages_consumed}</td>
+ <td style="text-align: right;">{item_bytes_produced}</td>
+ <td style="text-align: right;">{item_bytes_consumed}</td>
</tr>
Modified: mgmt/cumin/python/cumin/virtualhost.strings
===================================================================
--- mgmt/cumin/python/cumin/virtualhost.strings 2007-10-23 12:55:04 UTC (rev 1141)
+++ mgmt/cumin/python/cumin/virtualhost.strings 2007-10-23 14:19:24 UTC (rev 1142)
@@ -5,7 +5,8 @@
<th>Configuration</th>
<th>Status</th>
</tr>
-{items}
+
+ {items}
</table>
[VirtualHostSet.item_html]
@@ -17,6 +18,12 @@
[VirtualHostView.html]
<div class="oblock">
+ <div class="mstatus green" id="{id}">
+ <h2>Functional Host Status</h2>
+
+ <div>0 errors, 0 warnings</div>
+ </div>
+
<h1>{title}</h1>
<dl class="properties">
17 years, 4 months
rhmessaging commits: r1141 - in store/trunk/cpp: tests and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: cctrieloff
Date: 2007-10-23 08:55:04 -0400 (Tue, 23 Oct 2007)
New Revision: 1141
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/tests/SimpleTest.cpp
Log:
- updated test to be honor dir set
- disable dequeue callback until AMQP can support it
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-10-23 00:56:26 UTC (rev 1140)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-10-23 12:55:04 UTC (rev 1141)
@@ -579,7 +579,6 @@
jcntl::aio_wr_callback(jcntl* journal, u_int32_t num_dtoks)
{
//kpvdr TODO -- this list needs to be mutexed...???
-// need to delete the dtok's
std::deque<rhm::journal::data_tok*> this_dtok_list(journal->_aio_wr_cmpl_dtok_list.begin(),
journal->_aio_wr_cmpl_dtok_list.end());
@@ -595,9 +594,11 @@
dtokp->getSourceMessage()->enqueueComplete();
break;
case data_tok::DEQ:
+/* Don't need to signal until we have a way to ack completion of dequeue in AMQP
dtokp->getSourceMessage()->dequeueComplete();
if ( dtokp->getSourceMessage()->isDequeueComplete() ) // clear id after last dequeue
dtokp->getSourceMessage()->setPersistenceId(0);
+*/
break;
default:
;
@@ -613,7 +614,6 @@
{
//kpvdr TODO -- can we get rid of the copy???
-// need to delete the dtok's
std::deque<rhm::journal::data_tok*> this_dtok_list(journal->_aio_rd_cmpl_dtok_list.begin(),
journal->_aio_rd_cmpl_dtok_list.end());
journal->_aio_rd_cmpl_dtok_list.clear();
Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp 2007-10-23 00:56:26 UTC (rev 1140)
+++ store/trunk/cpp/tests/SimpleTest.cpp 2007-10-23 12:55:04 UTC (rev 1141)
@@ -313,9 +313,9 @@
}
}
- void testStagingSync() {testStaging();}
+ void testStagingSync() {testStaging(false);}
void testStagingAsync() {std::cout << std::endl << "Missing Async test!!" << std::endl << std:: flush;}
- void testStaging()
+ void testStaging(bool async)
{
const string name("MyDurableQueue");
const string exchange("MyExchange");
@@ -325,6 +325,7 @@
const string data2("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
{
BdbMessageStore store;
+ if (async) store.init("/var",async);
store.truncate();//make sure it is empty to begin with
//create & stage a message
@@ -368,6 +369,7 @@
{
//recover
BdbMessageStore store;
+ if (async) store.init("/var",async);
QueueRegistry registry(&store);
ExchangeRegistry exchanges;
DtxManager dtx(&store);
@@ -408,11 +410,12 @@
}
}
- void testDestroyStagedMessageSync() {testDestroyStagedMessage();}
+ void testDestroyStagedMessageSync() {testDestroyStagedMessage(false);}
void testDestroyStagedMessageAsync() {std::cout << std::endl << "Missing Async test!!" << std::endl << std:: flush;}
- void testDestroyStagedMessage()
+ void testDestroyStagedMessage(bool async)
{
BdbMessageStore store;
+ if (async) store.init("/var",async);
store.truncate();//make sure it is empty to begin with
const string data("abcdefg");
@@ -430,11 +433,12 @@
}
}
- void testDestroyEnqueuedMessageSync() {testDestroyEnqueuedMessage();}
+ void testDestroyEnqueuedMessageSync() {testDestroyEnqueuedMessage(false);}
void testDestroyEnqueuedMessageAsync() {std::cout << std::endl << "Missing Async test!!" << std::endl << std:: flush;}
- void testDestroyEnqueuedMessage()
+ void testDestroyEnqueuedMessage(bool async)
{
BdbMessageStore store;
+ if (async) store.init("/var",async);
store.truncate();//make sure it is empty to begin with
const string data("abcdefg");
17 years, 4 months
rhmessaging commits: r1140 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-22 20:56:26 -0400 (Mon, 22 Oct 2007)
New Revision: 1140
Added:
mgmt/cumin/python/cumin/client.strings
Modified:
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/demo.py
mgmt/cumin/python/cumin/model.py
Log:
Adds client stats.
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-10-22 21:03:02 UTC (rev 1139)
+++ mgmt/cumin/python/cumin/client.py 2007-10-23 00:56:26 UTC (rev 1140)
@@ -5,7 +5,7 @@
from parameters import *
from util import *
-#strings = StringCatalog(__file__)
+strings = StringCatalog(__file__)
class ClientSet(ItemSet):
def render_title(self, session, vhost):
@@ -14,6 +14,19 @@
def get_items(self, session, vhost):
return sorted_by(vhost.client_items(), "address")
- def render_item_link(self, session, client):
- branch = session.branch()
- return mlink(branch.marshal(), "Client", client.address)
+ def render_item_address(self, session, client):
+ #branch = session.branch()
+ #return mlink(branch.marshal(), "Client", client.address)
+ return client.address
+
+ def render_item_messages_produced(self, session, client):
+ return client.get_measurement("msgsProduced").get_value()
+
+ def render_item_bytes_produced(self, session, client):
+ return client.get_measurement("bytesProduced").get_value()
+
+ def render_item_messages_consumed(self, session, client):
+ return client.get_measurement("msgsConsumed").get_value()
+
+ def render_item_bytes_consumed(self, session, client):
+ return client.get_measurement("bytesConsumed").get_value()
Added: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings (rev 0)
+++ mgmt/cumin/python/cumin/client.strings 2007-10-23 00:56:26 UTC (rev 1140)
@@ -0,0 +1,35 @@
+[ClientSet.html]
+<form>
+ <select>
+ <option>Act on Selection...</option>
+ <option>Close Client</option>
+ <option>Detach Client</option>
+ </select>
+
+ <input type="Submit" value="Submit">
+
+ <br/><br/>
+
+ <table class="mobjects">
+ <tr>
+ <th><input type="checkbox"/></th>
+ <th>Client</th>
+ <th>Messages Produced</th>
+ <th>Bytes Produced</th>
+ <th>Messages Consumed</th>
+ <th>Bytes Consumed</th>
+ </tr>
+
+ {items}
+ </table>
+</form>
+
+[ClientSet.item_html]
+<tr>
+ <td><input type="checkbox"/></td>
+ <td>{item_address}</td>
+ <td>{item_messages_produced}</td>
+ <td>{item_messages_consumed}</td>
+ <td>{item_bytes_produced}</td>
+ <td>{item_bytes_consumed}</td>
+</tr>
Modified: mgmt/cumin/python/cumin/demo.py
===================================================================
--- mgmt/cumin/python/cumin/demo.py 2007-10-22 21:03:02 UTC (rev 1139)
+++ mgmt/cumin/python/cumin/demo.py 2007-10-23 00:56:26 UTC (rev 1140)
@@ -207,6 +207,14 @@
finally:
queue.unlock()
+ for client in vhost.client_items():
+ client.lock()
+ try:
+ for measure in client.measurements:
+ self.frob_measure(measure)
+ finally:
+ client.unlock()
+
if __name__ == "__main__":
import sys
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-10-22 21:03:02 UTC (rev 1139)
+++ mgmt/cumin/python/cumin/model.py 2007-10-23 00:56:26 UTC (rev 1140)
@@ -619,3 +619,31 @@
super(Client, self).__init__(model, model.client)
self.address = None
+
+ self.measurements = list()
+
+ measure = Measurement("msgsProduced", "int")
+ measure.title = "Messages produced"
+ measure.categories = ("message", "general")
+ self.measurements.append(measure)
+
+ measure = Measurement("msgsConsumed", "int")
+ measure.title = "Messages consumed"
+ measure.categories = ("message", "general")
+ self.measurements.append(measure)
+
+ measure = Measurement("bytesProduced", "int")
+ measure.title = "Bytes produced"
+ measure.categories = ("byte", "general")
+ self.measurements.append(measure)
+
+ measure = Measurement("bytesConsumed", "int")
+ measure.title = "Bytes consumed"
+ measure.categories = ("message", "general")
+ self.measurements.append(measure)
+
+ def get_measurement(self, name):
+ for measure in self.measurements:
+ if measure.name == name:
+ return measure
+
17 years, 4 months
rhmessaging commits: r1139 - in mgmt/cumin/python: wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-22 17:03:02 -0400 (Mon, 22 Oct 2007)
New Revision: 1139
Added:
mgmt/cumin/python/cumin/client.py
Modified:
mgmt/cumin/python/cumin/demo.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/virtualhost.py
mgmt/cumin/python/wooly/resources.py
Log:
Adds a clients tab to the vhost view.
Added: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py (rev 0)
+++ mgmt/cumin/python/cumin/client.py 2007-10-22 21:03:02 UTC (rev 1139)
@@ -0,0 +1,19 @@
+from wooly import *
+from wooly.widgets import *
+
+from widgets import *
+from parameters import *
+from util import *
+
+#strings = StringCatalog(__file__)
+
+class ClientSet(ItemSet):
+ def render_title(self, session, vhost):
+ return "Clients (%i)" % len(vhost.client_items())
+
+ def get_items(self, session, vhost):
+ return sorted_by(vhost.client_items(), "address")
+
+ def render_item_link(self, session, client):
+ branch = session.branch()
+ return mlink(branch.marshal(), "Client", client.address)
Modified: mgmt/cumin/python/cumin/demo.py
===================================================================
--- mgmt/cumin/python/cumin/demo.py 2007-10-22 20:25:38 UTC (rev 1138)
+++ mgmt/cumin/python/cumin/demo.py 2007-10-22 21:03:02 UTC (rev 1139)
@@ -144,6 +144,11 @@
queue.name = fmt("queue", queue_count)
vhost.add_queue(queue)
+ for num in range(100, 200, 10):
+ client = Client(self.model)
+ client.address = "192.168.0.%i:16565" % num
+ vhost.add_client(client)
+
def start_updates(self):
thread = UpdateThread(self.model)
thread.start()
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-10-22 20:25:38 UTC (rev 1138)
+++ mgmt/cumin/python/cumin/model.py 2007-10-22 21:03:02 UTC (rev 1139)
@@ -15,6 +15,7 @@
self.virtual_host_group = ModelClass(self, "virtual_host_group")
self.queue = ModelClass(self, "queue")
self.exchange = ModelClass(self, "exchange")
+ self.client = ModelClass(self, "client")
self.realm = ModelClass(self, "realm")
self.binding = ModelClass(self, "binding")
@@ -71,6 +72,10 @@
assoc.add_endpoint(self.virtual_host, "exchange", "0..n")
assoc.add_endpoint(self.exchange, "virtual_host", "0..1")
+ assoc = ModelAssociation(self, "virtual_host_to_clients")
+ assoc.add_endpoint(self.virtual_host, "client", "0..n")
+ assoc.add_endpoint(self.client, "virtual_host", "0..1")
+
assoc = ModelAssociation(self, "virtual_host_to_realms")
assoc.add_endpoint(self.virtual_host, "realm", "0..n")
assoc.add_endpoint(self.realm, "virtual_host", "0..1")
@@ -146,6 +151,9 @@
def get_exchange(self, id):
return self.get_index(self.exchange).get(id)
+ def get_client(self, id):
+ return self.get_index(self.client).get(id)
+
def get_realm(self, id):
return self.get_index(self.realm).get(id)
@@ -605,3 +613,9 @@
writer.write("<queue ref=\"queue-%i\"/>" % self.queue.id)
writer.write("<routing-key>%s</routing-key>" % self.routing_key)
writer.write("</binding>")
+
+class Client(ModelObject):
+ def __init__(self, model):
+ super(Client, self).__init__(model, model.client)
+
+ self.address = None
Modified: mgmt/cumin/python/cumin/virtualhost.py
===================================================================
--- mgmt/cumin/python/cumin/virtualhost.py 2007-10-22 20:25:38 UTC (rev 1138)
+++ mgmt/cumin/python/cumin/virtualhost.py 2007-10-22 21:03:02 UTC (rev 1139)
@@ -2,8 +2,8 @@
from wooly.widgets import *
from queue import *
-from realm import *
from exchange import *
+from client import *
from widgets import *
from parameters import *
from util import *
@@ -63,6 +63,7 @@
self.tabs.add_tab(QueueSet(app, "queues"))
self.tabs.add_tab(ExchangeSet(app, "exchanges"))
+ self.tabs.add_tab(ClientSet(app, "clients"))
def render_title(self, session, vhost):
return "Functional Host '%s'" % vhost.name
Modified: mgmt/cumin/python/wooly/resources.py
===================================================================
--- mgmt/cumin/python/wooly/resources.py 2007-10-22 20:25:38 UTC (rev 1138)
+++ mgmt/cumin/python/wooly/resources.py 2007-10-22 21:03:02 UTC (rev 1139)
@@ -13,6 +13,7 @@
try:
file = open(self.path)
self.strings = parse_catalog_file(file)
+ # XXX catch file not found
finally:
file.close()
17 years, 4 months