Author: justi9
Date: 2007-11-15 14:27:19 -0500 (Thu, 15 Nov 2007)
New Revision: 1319
Modified:
mgmt/cumin/python/cumin/__init__.py
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/formats.py
mgmt/cumin/python/cumin/measurement.py
mgmt/cumin/python/cumin/page.py
mgmt/cumin/python/cumin/parameters.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/widgets.py
mgmt/mint/python/mint/schema.py
mgmt/mint/python/mint/schema.sql
mgmt/mint/schemaparser.py
mgmt/misc/mint-test.py
Log:
Big changes to use the mint model from Nuno instead of the dummy
model. With this commit, brokers and all objects under brokers use
the new model. The old model is still used for the grouping
constructs.
Also revs the schema (as of 14 Nov) and uncomments some lines in
schemaparser.py.
Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/cumin/python/cumin/__init__.py 2007-11-15 19:27:19 UTC (rev 1319)
@@ -33,9 +33,9 @@
self.mint = MintModel()
try:
- sys = MgmtSystem.get(1)
+ sys = MintSystem.get(1)
except SQLObjectNotFound:
- sys = MgmtSystem()
+ sys = MintSystem()
sys.set(sysIdent=0, idOriginal=0)
self.model.sys = sys
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/cumin/python/cumin/broker.py 2007-11-15 19:27:19 UTC (rev 1319)
@@ -19,15 +19,15 @@
return "Brokers %s" % fmt_count(len(model.get_brokers()))
def get_items(self, session, model):
- return sorted_by(model.get_brokers())
+ return sorted_by(model.sys.brokers, "id")
def render_item_link(self, session, broker):
branch = session.branch()
self.page().show_broker(branch, broker).show_view(branch)
- return fmt_olink(branch, broker)
+ return fmt_olink(branch, broker, name=broker.port)
def render_item_group_link(self, session, broker):
- group = broker.get_broker_group()
+ group = None #broker.get_broker_group()
if group:
branch = session.branch()
@@ -37,7 +37,7 @@
return fmt_none()
def render_item_profile_link(self, session, broker):
- profile = broker.get_broker_profile()
+ profile = None #broker.get_broker_profile()
if profile:
branch = session.branch()
@@ -47,7 +47,7 @@
return fmt_none()
def render_item_cluster_link(self, session, broker):
- cluster = broker.get_broker_cluster()
+ cluster = None #broker.get_broker_cluster()
if cluster:
branch = session.branch()
@@ -57,7 +57,7 @@
return fmt_none()
def render_item_status(self, session, broker):
- return fmt_status(len(broker.errors), len(broker.warnings))
+ return None #fmt_status(len(broker.errors), len(broker.warnings))
def render_item_load(self, session, broker):
return "%.2f" % random()
@@ -141,7 +141,7 @@
return self.show_mode(session, self.client)
def get_title(self, session, broker):
- return "Broker '%s'" % broker.name
+ return "Broker '%s'" % broker.port
class BrokerConfigPropertyForm(CuminForm, Frame):
def __init__(self, app, name):
@@ -249,13 +249,13 @@
return self.tabs.show_mode(session, self.config)
def get_title(self, session, broker):
- return "Broker '%s'" % broker.name
+ return "Broker '%s'" % broker.port
def render_name(self, session, broker):
- return broker.name
+ return broker.port
def render_cluster_link(self, session, broker):
- cluster = broker.get_broker_cluster()
+ cluster = None #broker.get_broker_cluster()
if cluster:
branch = session.branch()
@@ -265,7 +265,7 @@
return fmt_none()
def render_profile_link(self, session, broker):
- profile = broker.get_broker_profile()
+ profile = None #broker.get_broker_profile()
if profile:
branch = session.branch()
@@ -279,27 +279,27 @@
class BrokerQueueTab(QueueSet):
def get_title(self, session, broker):
- count = len(broker.default_virtual_host.queue_items())
- return "Queues %s" % fmt_count(count)
+ vhost = self.get_object(session, broker)
+ return "Queues %s" % fmt_count(len(vhost.queues))
def get_object(self, session, broker):
- return broker.default_virtual_host
+ return MintVhost.selectBy(mintBrokerID=broker.id, name="/")[0]
class BrokerExchangeTab(ExchangeSet):
def get_title(self, session, broker):
- count = len(broker.default_virtual_host.exchange_items())
- return "Exchanges %s" % fmt_count(count)
+ vhost = self.get_object(session, broker)
+ return "Exchanges %s" % fmt_count(len(vhost.exchanges))
def get_object(self, session, broker):
- return broker.default_virtual_host
+ return MintVhost.selectBy(mintBrokerID=broker.id, name="/")[0]
class BrokerClientTab(ClientSet):
def get_title(self, session, broker):
- count = len(broker.default_virtual_host.client_items())
- return "Clients %s" % fmt_count(count)
+ vhost = self.get_object(session, broker)
+ return "Clients %s" % fmt_count(len(vhost.clients))
def get_object(self, session, broker):
- return broker.default_virtual_host
+ return MintVhost.selectBy(mintBrokerID=broker.id, name="/")[0]
class BrokerVirtualHostTab(VirtualHostSet):
def get_title(self, session, broker):
@@ -314,7 +314,7 @@
return "Configuration"
def get_items(self, session, broker):
- return sorted_by(broker.config_property_items())
+ return list() #XXX sorted_by(broker.config_property_items())
def maybe_highlight(self, value, comparedto):
if str(value) != str(comparedto):
@@ -366,6 +366,9 @@
class BrowserBrokers(BrokerSetForm):
def get_items(self, session, model):
+ return super(BrokerBrowser.BrowserBrokers, self).get_items \
+ (session, model)
+
brokers = sorted_by(model.get_brokers())
group = self.parent().group.get(session)
profile = self.parent().profile.get(session)
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/cumin/python/cumin/client.py 2007-11-15 19:27:19 UTC (rev 1319)
@@ -17,39 +17,39 @@
self.add_child(self.unit)
def get_title(self, session, vhost):
- return "Clients %s" % fmt_count(len(vhost.client_items()))
+ return "Clients %s" % fmt_count(len(vhost.clients))
def render_unit_plural(self, session, vhost):
return self.unit.get(session) == "b" and "Bytes" or
"Msgs."
def get_items(self, session, vhost):
- return sorted_by(vhost.client_items(), "address")
+ return sorted_by(vhost.clients, "ipAddr")
def render_item_link(self, session, client):
branch = session.branch()
self.page().show_client(branch, client).show_view(branch)
- return fmt_olink(branch, client.address)
+ return fmt_olink(branch, client, name=client.ipAddr)
def render_item_sessions(self, session, client):
branch = session.branch()
frame = self.page().show_client(branch, client)
frame.show_view(branch).show_sessions(branch)
- return fmt_link(branch.marshal(), len(client.session_items()))
+ return fmt_link(branch.marshal(), len(client.sessions))
def render_item_produced(self, session, client):
unit = self.unit.get(session)
key = unit == "b" and "bytesProduced" or
"msgsProduced"
- value = client.get_measurement(key).get_rate()
+ value = getattr(client.mintClientStats, key)
return fmt_rate(value, unit == "b" and "byte" or
"msg", "sec")
def render_item_consumed(self, session, client):
unit = self.unit.get(session)
key = unit == "b" and "bytesConsumed" or
"msgsConsumed"
- value = client.get_measurement(key).get_rate()
+ value = getattr(client.mintClientStats, key)
return fmt_rate(value, unit == "b" and "byte" or
"msg", "sec")
def render_item_status(self, session, client):
- return fmt_status(len(client.errors), len(client.warnings))
+ return None #XXX fmt_status(len(client.errors), len(client.warnings))
class ClientFrame(CuminFrame):
def __init__(self, app, name):
@@ -64,23 +64,23 @@
self.set_view_mode(self.view)
def get_title(self, session, client):
- return "Client %s" % client.address
+ return "Client %s" % client.ipAddr
class ClientStatus(CuminStatus):
def render_messages_produced(self, session, client):
- value = client.get_measurement("msgsProduced").get_rate()
+ value = client.mintClientStats.msgsProduced
return fmt_rate(value, "msg", "sec")
def render_messages_consumed(self, session, client):
- value = client.get_measurement("msgsConsumed").get_rate()
+ value = client.mintClientStats.msgsConsumed
return fmt_rate(value, "msg", "sec")
def render_bytes_produced(self, session, client):
- value = client.get_measurement("bytesProduced").get_rate()
+ value = client.mintClientStats.bytesProduced
return fmt_rate(value, "byte", "sec")
def render_bytes_consumed(self, session, client):
- value = client.get_measurement("bytesConsumed").get_rate()
+ value = client.mintClientStats.bytesConsumed
return fmt_rate(value, "byte", "sec")
class ClientView(Widget):
@@ -102,13 +102,13 @@
return self.tabs.show_mode(session, self.sessions)
def get_title(self, session, client):
- return "Client '%s'" % client.address
+ return "Client '%s'" % client.ipAddr
def render_data_url(self, session, client):
return "client.xml?id=%i" % client.id
def render_address(self, session, client):
- return client.address
+ return client.ipAddr
def render_auth_id(self, session, client):
return "e50e7dcaa8d6a039a"
@@ -161,18 +161,18 @@
return session_.name
def render_item_remaining_lifespan(self, session, session_):
- value = session_.get_measurement("remainingLifespan").get_value()
+ value = session_.mintSessionStats.remainingLifespan
return fmt_duration(value)
def render_item_frames_outstanding(self, session, session_):
- return session_.get_measurement("framesOutstanding").get_value()
+ return session_.mintSessionStats.framesOutstanding
def render_item_attached(self, session, session_):
- result = session_.get_measurement("attached").get_value()
- return fmt_predicate(result)
+ value = session_.mintSessionStats.attached
+ return fmt_predicate(value)
def render_item_status(self, session, session_):
- return fmt_status(len(session_.errors), len(session_.warnings))
+ return None #XXX fmt_status(len(session_.errors), len(session_.warnings))
class ClientXmlPage(CuminXmlPage):
def __init__(self, app, name):
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/cumin/python/cumin/exchange.py 2007-11-15 19:27:19 UTC (rev 1319)
@@ -21,7 +21,7 @@
self.set_parameter(param)
def get_items(self, session, vhost):
- return sorted_by(vhost.exchange_items())
+ return sorted_by(vhost.exchanges)
def render_item_value(self, session, exchange):
return exchange.id
@@ -40,13 +40,13 @@
self.add_child(self.unit)
def get_title(self, session, vhost):
- return "Exchanges (%s)" % len(vhost.exchange_items())
+ return "Exchanges %s" % fmt_count(len(vhost.exchanges))
def render_unit_plural(self, session, vhost):
return self.unit.get(session) == "b" and "Bytes" or
"Msgs."
def get_items(self, session, vhost):
- return sorted_by(vhost.exchange_items())
+ return sorted_by(vhost.exchanges)
def render_item_link(self, session, exchange):
branch = session.branch()
@@ -57,33 +57,33 @@
branch = session.branch()
frame = self.page().show_exchange(branch, exchange)
frame.show_view(branch).show_producers(branch)
- return fmt_link(branch.marshal(), len(exchange.producer_items()))
+ return fmt_link(branch.marshal(), len(exchange.producers))
def render_item_bindings(self, session, exchange):
branch = session.branch()
frame = self.page().show_exchange(branch, exchange)
frame.show_view(branch).show_bindings(branch)
- return fmt_link(branch.marshal(), len(exchange.binding_items()))
+ return fmt_link(branch.marshal(), len(exchange.bindings))
def render_item_received(self, session, exchange):
unit = self.unit.get(session)
key = unit == "b" and "byteReceives" or
"msgReceives"
- value = exchange.get_measurement(key).get_rate()
+ value = getattr(exchange.mintExchangeStats, key)
return fmt_rate(value, unit == "b" and "byte" or
"msg", "sec")
def render_item_routed(self, session, exchange):
unit = self.unit.get(session)
key = unit == "b" and "byteRoutes" or "msgRoutes"
- value = exchange.get_measurement(key).get_rate()
+ value = getattr(exchange.mintExchangeStats, key)
return fmt_rate(value, unit == "b" and "byte" or
"msg", "sec")
def render_item_dropped(self, session, exchange):
unit = self.unit.get(session)
key = unit == "b" and "byteDrops" or "msgDrops"
- return exchange.get_measurement(key).get_value()
+ return getattr(exchange.mintExchangeStats, key)
def render_item_status(self, session, exchange):
- return fmt_status(len(exchange.errors), len(exchange.warnings))
+ return None #XXX fmt_status(len(exchange.errors), len(exchange.warnings))
def show_producers(page, session, exchange):
frame = page.show_exchange(session, exchange).show_view(session)
@@ -192,27 +192,27 @@
class ExchangeBindingSet(ItemSet):
def get_title(self, session, exchange):
- return "Queue Bindings %s" % fmt_count(len(exchange.binding_items()))
+ return "Queue Bindings %s" % fmt_count(len(exchange.bindings))
def get_items(self, session, exchange):
- return sorted_by(exchange.binding_items(), "id")
+ return sorted_by(exchange.bindings, "id")
def render_item_href(self, session, binding):
branch = session.branch()
- self.page().show_queue(branch, binding.queue)
+ self.page().show_queue(branch, binding.mintQueue)
return branch.marshal()
def render_item_name(self, session, binding):
- return binding.get_queue().name
+ return binding.mintQueue.name
def render_item_binding_key(self, session, binding):
- return binding.binding_key
+ return binding.bindingKey
def render_item_messages_matched(self, session, binding):
- return binding.get_measurement("msgMatched").get_value()
+ return binding.mintBindingStats.msgMatched
def render_item_messages_matched_rate(self, session, binding):
- value = binding.get_measurement("msgMatched").get_rate()
+ value = binding.mintBindingStats.msgMatched
return fmt_rate(value, "msg", "sec")
class ExchangeForm(CuminForm):
@@ -367,26 +367,26 @@
class ExchangeProducerSet(ItemSet):
def get_title(self, session, queue):
- return "Producers %s" % fmt_count(len(queue.producer_items()))
+ return "Producers %s" % fmt_count(len(queue.producers))
def get_items(self, session, queue):
- return sorted_by(queue.producer_items())
+ return sorted_by(queue.producers)
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()
+ return producer.mintProducerStats.msgsProduced
def render_item_messages_produced_rate(self, session, producer):
- value = producer.get_measurement("msgsProduced").get_rate()
+ value = producer.mintProducerStats.msgsProduced
return fmt_rate(value, "msg", "sec")
def render_item_bytes_produced(self, session, producer):
- return producer.get_measurement("bytesProduced").get_value()
+ return producer.mintProducerStats.bytesProduced
def render_item_bytes_produced_rate(self, session, producer):
- value = producer.get_measurement("bytesProduced").get_rate()
+ value = producer.mintProducerStats.bytesProduced
return fmt_rate(value, "byte", "sec")
class ExchangeXmlPage(CuminXmlPage):
Modified: mgmt/cumin/python/cumin/formats.py
===================================================================
--- mgmt/cumin/python/cumin/formats.py 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/cumin/python/cumin/formats.py 2007-11-15 19:27:19 UTC (rev 1319)
@@ -62,7 +62,7 @@
return "<a href=\"%s\"%s>%s</a>" % \
(href, class_ and " class=\"%s\" " % class_ or "
", content)
-def fmt_olink(session, object, selected=False):
+def fmt_olink(session, object, selected=False, name=None):
return fmt_link(session.marshal(),
- getattr(object, "name", object),
+ getattr(object, "name", name),
selected and "selected")
Modified: mgmt/cumin/python/cumin/measurement.py
===================================================================
--- mgmt/cumin/python/cumin/measurement.py 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/cumin/python/cumin/measurement.py 2007-11-15 19:27:19 UTC (rev 1319)
@@ -1,5 +1,6 @@
from wooly import *
from wooly.widgets import *
+from mint.schema import *
from widgets import *
from parameters import *
@@ -8,6 +9,205 @@
strings = StringCatalog(__file__)
+class Measure(object):
+ def __init__(self, name, unit, title=None, categories=()):
+ self.name = name
+ self.unit = unit
+ self.title = None
+ self.categories = categories
+
+ self.link_cb = None
+ self.highlow = False
+
+ def get(self, object):
+ return getattr(object, self.name)
+
+class MeasureMetadata(object):
+ def __init__(self):
+ self.queue = list()
+ self.exchange = list()
+ self.client = list()
+
+ m = Measure("consumers", "int")
+ m.title = "Consumers"
+ m.unit = "consumer"
+ m.categories = ("general")
+ m.highlow = True
+ self.queue.append(m)
+
+ m = Measure("bindings", "int")
+ m.title = "Bindings"
+ m.unit = "binding"
+ m.categories = ("general")
+ m.highlow = True
+ self.queue.append(m)
+
+ m = Measure("msgDepth", "int")
+ m.title = "Message Depth"
+ m.unit = "message"
+ m.categories = ("message", "general")
+ m.highlow = True
+ self.queue.append(m)
+
+ m = Measure("msgTotalEnqueues", "int")
+ m.title = "Msgs. Enqueued"
+ m.unit = "message"
+ m.categories = ("message", "general")
+ self.queue.append(m)
+
+ m = Measure("msgTotalDequeues", "int")
+ m.title = "Msgs. Dequeued"
+ m.unit = "message"
+ m.categories = ("message", "general")
+ self.queue.append(m)
+
+ m = Measure("byteDepth", "int")
+ m.title = "Byte Depth"
+ m.unit = "byte"
+ m.categories = ("byte", "general")
+ m.highlow = True
+ self.queue.append(m)
+
+ m = Measure("byteTotalEnqueues", "int")
+ m.title = "Bytes Enqueued"
+ m.unit = "byte"
+ m.categories = ("byte", "general")
+ self.queue.append(m)
+
+ m = Measure("byteTotalDequeues", "int")
+ m.title = "Bytes Dequeued"
+ m.unit = "byte"
+ m.categories = ("byte", "general")
+ self.queue.append(m)
+
+ m = Measure("unackedMessages", "int")
+ m.title = "Msgs. Unacked"
+ m.unit = "message"
+ m.categories = ("general")
+ self.queue.append(m)
+
+ # Disk
+
+ #m = Measure("diskPageSize", "int")
+ #m.title = "Page size"
+ #m.categories = ("disk")
+ #self.queue.append(m)
+
+ m = Measure("diskPages", "int")
+ m.title = "Disk Pages"
+ m.unit = "page"
+ m.categories = ("general")
+ self.queue.append(m)
+
+ #m = Measure("diskAvailableSize", "int")
+ #m.title = "Available size"
+ #m.categories = ("disk")
+ #self.queue.append(m)
+
+ # Transactional
+
+ m = Measure("msgTxnEnqueues", "int")
+ m.title = "Msgs. Enqueued"
+ m.unit = "message"
+ m.categories = ("message", "transactional")
+ self.queue.append(m)
+
+ m = Measure("msgTxnDequeues", "int")
+ m.title = "Msgs. Dequeued"
+ m.unit = "message"
+ m.categories = ("message", "transactional")
+ self.queue.append(m)
+
+ m = Measure("byteTxnEnqueues", "int")
+ m.title = "Bytes Enqueued"
+ m.unit = "byte"
+ m.categories = ("byte", "transactional")
+ self.queue.append(m)
+
+ m = Measure("byteTxnDequeues", "int")
+ m.title = "Bytes Dequeued"
+ m.unit = "byte"
+ m.categories = ("byte", "transactional")
+ self.queue.append(m)
+
+ m = Measure("enqueueTxnStarts", "int")
+ m.title = "Enq. Trans. Started"
+ m.unit = "transaction"
+ m.categories = ("transaction")
+ self.queue.append(m)
+
+ m = Measure("enqueueTxnCommits", "int")
+ m.title = "Enq. Trans. Committed"
+ m.unit = "transaction"
+ m.categories = ("transaction")
+ self.queue.append(m)
+
+ m = Measure("enqueueTxnRejects", "int")
+ m.title = "Enq. Trans. Rejected"
+ m.unit = "transaction"
+ m.categories = ("transaction")
+ self.queue.append(m)
+
+ m = Measure("enqueueTxnCount", "int")
+ m.title = "Enq. Trans. Pending"
+ m.unit = "transaction"
+ m.categories = ("transaction")
+ m.highlow = True
+ self.queue.append(m)
+
+ m = Measure("dequeueTxnStarts", "int")
+ m.title = "Deq. Trans. Started"
+ m.unit = "transaction"
+ m.categories = ("transaction")
+ self.queue.append(m)
+
+ m = Measure("dequeueTxnCommits", "int")
+ m.title = "Deq. Trans. Committed"
+ m.unit = "transaction"
+ m.categories = ("transaction")
+ self.queue.append(m)
+
+ m = Measure("dequeueTxnRejects", "int")
+ m.title = "Deq. Trans. Rejected"
+ m.unit = "transaction"
+ m.categories = ("transaction")
+ self.queue.append(m)
+
+ m = Measure("dequeueTxnCount", "int")
+ m.title = "Deq. Trans. Pending"
+ m.unit = "transaction"
+ m.categories = ("transaction")
+ m.highlow = True
+ self.queue.append(m)
+
+ # Persistent
+
+ m = Measure("msgPersistEnqueues", "int")
+ m.title = "Msgs. Enqueued"
+ m.unit = "message"
+ m.categories = ("message", "persistent")
+ self.queue.append(m)
+
+ m = Measure("msgPersistDequeues", "int")
+ m.title = "Msgs. Dequeued"
+ m.unit = "message"
+ m.categories = ("message", "persistent")
+ self.queue.append(m)
+
+ m = Measure("bytePersistEnqueues", "int")
+ m.title = "Bytes Enqueued"
+ m.unit = "byte"
+ m.categories = ("byte", "persistent")
+ self.queue.append(m)
+
+ m = Measure("bytePersistDequeues", "int")
+ m.title = "Bytes Dequeued"
+ m.unit = "byte"
+ m.categories = ("byte", "persistent")
+ self.queue.append(m)
+
+meta = MeasureMetadata()
+
class MeasurementSet(ItemSet):
unit_abbrevs = dict()
unit_abbrevs["message"] = "msg"
@@ -23,30 +223,45 @@
def get_items(self, session, object):
self.object.set(session, object);
-
- measures = list(object.measurements)
- for measure in object.measurements:
- if self.category not in measure.categories:
- measures.remove(measure)
+ if isinstance(object, MintQueue):
+ stats = object.mintQueueStats
+ elif isinstance(object, MintExchange):
+ stats = object.mintExchangeStats
+ elif isinstance(object, MintClient):
+ stats = object.mintClientStats
+ else:
+ raise Exception()
+ measures = list()
+
+ for measure in meta.queue:
+ if self.category in measure.categories:
+ measures.append((measure, stats))
+
return measures
- def render_item_title(self, session, measure):
+ def render_item_title(self, session, args):
+ measure, stats = args
return measure.title
- def render_item_name(self, session, measure):
+ def render_item_name(self, session, args):
+ measure, stats = args
return measure.name
- def render_item_value(self, session, measure):
+ def render_item_value(self, session, args):
+ measure, stats = args
+
if measure.link_cb:
branch = session.branch()
measure.link_cb(self.page(), branch, self.object.get(session))
- return fmt_link(branch.marshal(), measure.get_value())
+ return fmt_link(branch.marshal(), measure.get(stats))
else:
- return measure.get_value()
+ return measure.get(stats)
def render_item_extra(self, session, measure):
+ return None #XXX
+
if measure.highlow:
return
"<small>high</small> <span>%i</span>
<small>low</small> <span>%i</span>" \
% (measure.get_high() or 0, measure.get_low() or 0)
@@ -55,4 +270,4 @@
return fmt_rate(measure.get_rate(), unit, "sec")
def render_item_average(self, session, measure):
- return "%0.2f" % (sum(measure.values) / float(len(measure.values)))
+ return None #XXX "%0.2f" % (sum(measure.values) /
float(len(measure.values)))
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/cumin/python/cumin/page.py 2007-11-15 19:27:19 UTC (rev 1319)
@@ -75,7 +75,7 @@
return self.show_mode(session, self.view)
def show_broker(self, session, broker):
- cluster = broker.get_broker_cluster()
+ cluster = None #broker.get_broker_cluster()
if cluster:
frame = self.show_broker_cluster(session, cluster)
@@ -118,7 +118,7 @@
return self.set_current_frame(session, frame)
def show_queue(self, session, queue):
- broker = queue.get_virtual_host().get_broker()
+ broker = queue.mintVhost.mintBroker
frame = self.show_broker(session, broker)
frame = frame.show_queue(session, queue)
return self.set_current_frame(session, frame)
@@ -183,7 +183,7 @@
class BrokerTab(BrokerBrowser):
def get_title(self, session, model):
- return "Brokers %s" % fmt_count(len(model.get_brokers()))
+ return "Brokers %s" % fmt_count(len(model.sys.brokers))
class BrokerProfileTab(BrokerProfileSet):
def get_title(self, session, model):
Modified: mgmt/cumin/python/cumin/parameters.py
===================================================================
--- mgmt/cumin/python/cumin/parameters.py 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/cumin/python/cumin/parameters.py 2007-11-15 19:27:19 UTC (rev 1319)
@@ -1,4 +1,5 @@
from wooly import *
+from mint.schema import *
class BrokerClusterParameter(Parameter):
def do_unmarshal(self, string):
@@ -16,7 +17,7 @@
class BrokerParameter(Parameter):
def do_unmarshal(self, string):
- return self.app.model.get_broker(int(string))
+ return MintBroker.get(int(string))
def do_marshal(self, broker):
return str(broker.id)
@@ -30,7 +31,7 @@
class ClientParameter(Parameter):
def do_unmarshal(self, string):
- return self.app.model.get_client(int(string))
+ return MintClient.get(int(string))
def do_marshal(self, client):
return str(client.id)
@@ -44,14 +45,14 @@
class ExchangeParameter(Parameter):
def do_unmarshal(self, string):
- return self.app.model.get_exchange(int(string))
+ return MintExchange.get(int(string))
def do_marshal(self, exchange):
return str(exchange.id)
class QueueParameter(Parameter):
def do_unmarshal(self, string):
- return self.app.model.get_queue(int(string))
+ return MintQueue.get(int(string))
def do_marshal(self, queue):
return str(queue.id)
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-15 19:27:19 UTC (rev 1319)
@@ -21,7 +21,7 @@
self.add_child(self.unit)
def get_title(self, session, vhost):
- return "Queues (%s)" % len(vhost.queue_items())
+ return "Queues (%s)" % len(vhost.queues)
def render_unit_singular(self, session, vhost):
return self.unit.get(session) == "b" and "Byte" or
"Msg."
@@ -30,7 +30,7 @@
return self.unit.get(session) == "b" and "Bytes" or
"Msgs."
def get_items(self, session, vhost):
- return sorted_by(vhost.queue_items())
+ return sorted_by(vhost.queues)
def render_item_link(self, session, queue):
branch = session.branch()
@@ -41,41 +41,43 @@
return queue.name
def render_item_consumers(self, session, queue):
+ return None # XXX
+
branch = session.branch()
frame = self.page().show_queue(branch, queue)
frame.show_view(branch).show_consumers(branch)
- return fmt_link(branch.marshal(), len(queue.consumer_items()))
+ return fmt_link(branch.marshal(), len(queue.consumers))
def render_item_bindings(self, session, queue):
branch = session.branch()
frame = self.page().show_queue(branch, queue)
frame.show_view(branch).show_bindings(branch)
- return fmt_link(branch.marshal(), len(queue.binding_items()))
+ return fmt_link(branch.marshal(), len(queue.bindings))
def render_item_enqueued(self, session, queue):
unit = self.unit.get(session)
key = unit == "b" and "byteTotalEnqueues" or
"msgTotalEnqueues"
- value = queue.get_measurement(key).get_rate()
+ value = getattr(queue.mintQueueStats, key)
return fmt_rate(value, unit == "b" and "byte" or
"msg", "sec")
def render_item_dequeued(self, session, queue):
unit = self.unit.get(session)
key = unit == "b" and "byteTotalDequeues" or
"msgTotalDequeues"
- value = queue.get_measurement(key).get_rate()
+ value = getattr(queue.mintQueueStats, key)
return fmt_rate(value, unit == "b" and "byte" or
"msg", "sec")
def render_item_depth(self, session, queue):
key = self.unit.get(session) == "b" and "byteDepth" or
"msgDepth"
- return queue.get_measurement(key).get_value()
+ return getattr(queue.mintQueueStats, key)
def render_item_depth_accel(self, session, queue):
unit = self.unit.get(session)
key = unit == "b" and "byteDepth" or "msgDepth"
- value = queue.get_measurement(key).get_rate()
+ value = getattr(queue.mintQueueStats, key)
return fmt_rate(value, unit == "b" and "byte" or
"msg", "sec")
def render_item_status(self, session, queue):
- return fmt_status(len(queue.errors), len(queue.warnings))
+ return None #fmt_status(len(queue.errors), len(queue.warnings))
def show_consumers(page, session, queue):
frame = page.show_queue(session, queue).show_view(session)
@@ -100,8 +102,8 @@
# XXX not awesome
def get_object(self, session, object):
queue = self.param.get(session)
- queue.get_measurement("consumers").link_cb = show_consumers
- queue.get_measurement("bindings").link_cb = show_bindings
+ #queue_stat(queue, "consumers").link_cb = show_consumers
+ #queue_stat(queue, "bindings").link_cb = show_bindings
return queue
def get_title(self, session, queue):
@@ -109,36 +111,36 @@
class QueueStatus(CuminStatus):
def render_consumers(self, session, queue):
- return queue.get_measurement("consumers").get_value()
+ return queue.mintQueueStats.consumers
def render_messages_enqueued(self, session, queue):
- value = queue.get_measurement("msgTotalEnqueues").get_rate()
+ value = queue.mintQueueStats.msgTotalEnqueues
return fmt_rate(value, "msg", "sec")
def render_messages_dequeued(self, session, queue):
- value = queue.get_measurement("msgTotalDequeues").get_rate()
+ value = queue.mintQueueStats.msgTotalDequeues
return fmt_rate(value, "msg", "sec")
def render_message_depth(self, session, queue):
- return queue.get_measurement("msgDepth").get_value()
+ return queue.mintQueueStats.msgDepth
def render_message_depth_accel(self, session, queue):
- value = queue.get_measurement("msgDepth").get_rate()
+ value = queue.mintQueueStats.msgDepth
return fmt_rate(value, "msg", "sec")
def render_bytes_enqueued(self, session, queue):
- value = queue.get_measurement("byteTotalEnqueues").get_rate()
+ value = queue.mintQueueStats.byteTotalEnqueues
return fmt_rate(value, "byte", "sec")
def render_bytes_dequeued(self, session, queue):
- value = queue.get_measurement("byteTotalDequeues").get_rate()
+ value = queue.mintQueueStats.byteTotalDequeues
return fmt_rate(value, "byte", "sec")
def render_byte_depth(self, session, queue):
- return queue.get_measurement("byteDepth").get_value()
+ return queue.mintQueueStats.byteDepth
def render_byte_depth_accel(self, session, queue):
- value = queue.get_measurement("byteDepth").get_rate()
+ value = queue.mintQueueStats.byteDepth
return fmt_rate(value, "byte", "sec")
class QueueView(Widget):
@@ -175,10 +177,10 @@
return queue.name
def render_durable(self, session, queue):
- return fmt_predicate(queue.is_durable)
+ return fmt_predicate(queue.durable)
def render_exclusive(self, session, queue):
- return fmt_predicate(queue.is_exclusive)
+ return fmt_predicate(queue.exclusive)
def render_created_deleted(self, session, queue):
return "%s - %s" % (fmt_datetime(datetime.utcnow()), "")
@@ -188,10 +190,10 @@
class QueueBindingSet(ItemSet):
def get_title(self, session, queue):
- return "Exchange Bindings %s" % fmt_count(len(queue.binding_items()))
+ return "Exchange Bindings %s" % fmt_count(len(queue.bindings))
def get_items(self, session, queue):
- return sorted_by(queue.binding_items(), "id")
+ return sorted_by(queue.bindings, "id")
def render_item_href(self, session, binding):
branch = session.branch()
@@ -440,35 +442,35 @@
return "queue.png?id=%i;m=consumers" % queue.id
def render_transactions_chart_url(self, session, queue):
- return "queue.png?id=%i;m=enqueueTxCount;m=dequeueTxCount" \
+ return "queue.png?id=%i;m=enqueueTxnCount;m=dequeueTxnCount" \
% queue.id
class QueueConsumerSet(ItemSet):
def get_title(self, session, queue):
- return "Consumers %s" % fmt_count(len(queue.consumer_items()))
+ return "Consumers" #XXX %s" % fmt_count(len(queue.consumers))
def get_items(self, session, queue):
- return sorted_by(queue.consumer_items())
+ return list() #XXX sorted_by(queue.consumers)
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()
+ return consumer.mintConsumerStats.msgsConsumed
def render_item_messages_consumed_rate(self, session, consumer):
- value = consumer.get_measurement("msgsConsumed").get_rate()
+ value = consumer.mintConsumerStats.msgsConsumed
return fmt_rate(value, "msg", "sec")
def render_item_bytes_consumed(self, session, consumer):
- return consumer.get_measurement("bytesConsumed").get_value()
+ return consumer.mintConsumerStats.bytesConsumed
def render_item_bytes_consumed_rate(self, session, consumer):
- value = consumer.get_measurement("bytesConsumed").get_rate()
+ value = consumer.mintConsumerStats.bytesConsumed
return fmt_rate(value, "byte", "sec")
def render_item_unacked_messages(self, session, consumer):
- return consumer.get_measurement("unackedMessages").get_value()
+ return consumer.mintConsumerStats.unackedMessages
class QueueXmlPage(CuminXmlPage):
def __init__(self, app, name):
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/cumin/python/cumin/widgets.py 2007-11-15 19:27:19 UTC (rev 1319)
@@ -106,19 +106,24 @@
class CuminStatus(Widget):
def render_class(self, session, object):
- if object.errors:
- return "mstatus red"
- elif object.warnings:
- return "mstatus yellow"
+ if hasattr(object, "errors"):
+ if object.errors:
+ return "mstatus red"
+ elif object.warnings:
+ return "mstatus yellow"
+ else:
+ return "mstatus green"
else:
return "mstatus green"
def render_status_info(self, session, object):
- error_count = len(object.errors)
- warning_count = len(object.warnings)
+ if hasattr(object, "errors"):
+ error_count = len(object.errors)
+ warning_count = len(object.warnings)
- return "%i error%s, %i warning%s" % (error_count, ess(error_count),
- warning_count, ess(warning_count))
+ return "%i error%s, %i warning%s" % \
+ (error_count, ess(error_count),
+ warning_count, ess(warning_count))
class CuminChartPage(Page):
def __init__(self, app, name):
Modified: mgmt/mint/python/mint/schema.py
===================================================================
--- mgmt/mint/python/mint/schema.py 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/mint/python/mint/schema.py 2007-11-15 19:27:19 UTC (rev 1319)
@@ -1,22 +1,22 @@
from sqlobject import *
-class MgmtSystemStats(SQLObject):
+class MintSystemStats(SQLObject):
class sqlmeta:
fromDatabase = True
-class MgmtSystem(SQLObject):
+class MintSystem(SQLObject):
schemaId = 1
schemaName = "system"
managedBroker = None
class sqlmeta:
fromDatabase = True
- _SO_class_Mgmt_system_stats = None
+ _SO_class_Mint_system_stats = MintSystemStats
-class MgmtBrokerStats(SQLObject):
+class MintBrokerStats(SQLObject):
class sqlmeta:
fromDatabase = True
-class MgmtBroker(SQLObject):
+class MintBroker(SQLObject):
schemaId = 2
schemaName = "broker"
managedBroker = None
@@ -42,31 +42,31 @@
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"crash", args=actualArgs, packageName="qpid")
- _SO_class_Mgmt_broker_stats = None
- _SO_class_Mgmt_system = None
+ _SO_class_Mint_broker_stats = MintBrokerStats
+ _SO_class_Mint_system = MintSystem
-class MgmtVhostStats(SQLObject):
+class MintVhostStats(SQLObject):
class sqlmeta:
fromDatabase = True
-MgmtSystem.sqlmeta.addJoin(MultipleJoin('MgmtBroker',
joinMethodName='allBrokers'))
+MintSystem.sqlmeta.addJoin(MultipleJoin('MintBroker',
joinMethodName='brokers'))
-class MgmtVhost(SQLObject):
+class MintVhost(SQLObject):
schemaId = 3
schemaName = "vhost"
managedBroker = None
class sqlmeta:
fromDatabase = True
- _SO_class_Mgmt_vhost_stats = None
- _SO_class_Mgmt_broker = None
+ _SO_class_Mint_vhost_stats = MintVhostStats
+ _SO_class_Mint_broker = MintBroker
-class MgmtQueueStats(SQLObject):
+class MintQueueStats(SQLObject):
class sqlmeta:
fromDatabase = True
-MgmtBroker.sqlmeta.addJoin(MultipleJoin('MgmtVhost',
joinMethodName='allVhosts'))
+MintBroker.sqlmeta.addJoin(MultipleJoin('MintVhost',
joinMethodName='vhosts'))
-class MgmtQueue(SQLObject):
+class MintQueue(SQLObject):
schemaId = 4
schemaName = "queue"
managedBroker = None
@@ -83,48 +83,48 @@
actualArgs["pages"] = pages
methodId = model.registerCallback(callbackMethod)
self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"increaseDiskSize", args=actualArgs, packageName="qpid")
- _SO_class_Mgmt_queue_stats = None
- _SO_class_Mgmt_vhost = None
+ _SO_class_Mint_queue_stats = MintQueueStats
+ _SO_class_Mint_vhost = MintVhost
-class MgmtExchangeStats(SQLObject):
+class MintExchangeStats(SQLObject):
class sqlmeta:
fromDatabase = True
-MgmtVhost.sqlmeta.addJoin(MultipleJoin('MgmtQueue',
joinMethodName='allQueues'))
+MintVhost.sqlmeta.addJoin(MultipleJoin('MintQueue',
joinMethodName='queues'))
-class MgmtExchange(SQLObject):
+class MintExchange(SQLObject):
schemaId = 5
schemaName = "exchange"
managedBroker = None
class sqlmeta:
fromDatabase = True
- _SO_class_Mgmt_exchange_stats = None
- _SO_class_Mgmt_vhost = None
+ _SO_class_Mint_exchange_stats = MintExchangeStats
+ _SO_class_Mint_vhost = MintVhost
-class MgmtBindingStats(SQLObject):
+class MintBindingStats(SQLObject):
class sqlmeta:
fromDatabase = True
-MgmtVhost.sqlmeta.addJoin(MultipleJoin('MgmtExchange',
joinMethodName='allExchanges'))
+MintVhost.sqlmeta.addJoin(MultipleJoin('MintExchange',
joinMethodName='exchanges'))
-class MgmtBinding(SQLObject):
+class MintBinding(SQLObject):
schemaId = 6
schemaName = "binding"
managedBroker = None
class sqlmeta:
fromDatabase = True
- _SO_class_Mgmt_binding_stats = None
- _SO_class_Mgmt_queue = None
- _SO_class_Mgmt_exchange = None
+ _SO_class_Mint_binding_stats = MintBindingStats
+ _SO_class_Mint_queue = MintQueue
+ _SO_class_Mint_exchange = MintExchange
-class MgmtClientStats(SQLObject):
+class MintClientStats(SQLObject):
class sqlmeta:
fromDatabase = True
-MgmtQueue.sqlmeta.addJoin(MultipleJoin('MgmtBinding',
joinMethodName='allBindings'))
-MgmtExchange.sqlmeta.addJoin(MultipleJoin('MgmtBinding',
joinMethodName='allBindings'))
+MintQueue.sqlmeta.addJoin(MultipleJoin('MintBinding',
joinMethodName='bindings'))
+MintExchange.sqlmeta.addJoin(MultipleJoin('MintBinding',
joinMethodName='bindings'))
-class MgmtClient(SQLObject):
+class MintClient(SQLObject):
schemaId = 7
schemaName = "client"
managedBroker = None
@@ -138,16 +138,16 @@
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"detach", args=actualArgs, packageName="qpid")
- _SO_class_Mgmt_client_stats = None
- _SO_class_Mgmt_vhost = None
+ _SO_class_Mint_client_stats = MintClientStats
+ _SO_class_Mint_vhost = MintVhost
-class MgmtSessionStats(SQLObject):
+class MintSessionStats(SQLObject):
class sqlmeta:
fromDatabase = True
-MgmtVhost.sqlmeta.addJoin(MultipleJoin('MgmtClient',
joinMethodName='allClients'))
+MintVhost.sqlmeta.addJoin(MultipleJoin('MintClient',
joinMethodName='clients'))
-class MgmtSession(SQLObject):
+class MintSession(SQLObject):
schemaId = 8
schemaName = "session"
managedBroker = None
@@ -169,18 +169,18 @@
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"close", args=actualArgs, packageName="qpid")
- _SO_class_Mgmt_session_stats = None
- _SO_class_Mgmt_vhost = None
- _SO_class_Mgmt_client = None
+ _SO_class_Mint_session_stats = MintSessionStats
+ _SO_class_Mint_vhost = MintVhost
+ _SO_class_Mint_client = MintClient
-class MgmtDestinationStats(SQLObject):
+class MintDestinationStats(SQLObject):
class sqlmeta:
fromDatabase = True
-MgmtVhost.sqlmeta.addJoin(MultipleJoin('MgmtSession',
joinMethodName='allSessions'))
-MgmtClient.sqlmeta.addJoin(MultipleJoin('MgmtSession',
joinMethodName='allSessions'))
+MintVhost.sqlmeta.addJoin(MultipleJoin('MintSession',
joinMethodName='sessions'))
+MintClient.sqlmeta.addJoin(MultipleJoin('MintSession',
joinMethodName='sessions'))
-class MgmtDestination(SQLObject):
+class MintDestination(SQLObject):
schemaId = 9
schemaName = "destination"
managedBroker = None
@@ -200,33 +200,33 @@
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"start", args=actualArgs, packageName="qpid")
- _SO_class_Mgmt_destination_stats = None
- _SO_class_Mgmt_session = None
+ _SO_class_Mint_destination_stats = MintDestinationStats
+ _SO_class_Mint_session = MintSession
-class MgmtProducerStats(SQLObject):
+class MintProducerStats(SQLObject):
class sqlmeta:
fromDatabase = True
-MgmtSession.sqlmeta.addJoin(MultipleJoin('MgmtDestination',
joinMethodName='allDestinations'))
+MintSession.sqlmeta.addJoin(MultipleJoin('MintDestination',
joinMethodName='destinations'))
-class MgmtProducer(SQLObject):
+class MintProducer(SQLObject):
schemaId = 10
schemaName = "producer"
managedBroker = None
class sqlmeta:
fromDatabase = True
- _SO_class_Mgmt_producer_stats = None
- _SO_class_Mgmt_destination = None
- _SO_class_Mgmt_exchange = None
+ _SO_class_Mint_producer_stats = MintProducerStats
+ _SO_class_Mint_destination = MintDestination
+ _SO_class_Mint_exchange = MintExchange
-class MgmtConsumerStats(SQLObject):
+class MintConsumerStats(SQLObject):
class sqlmeta:
fromDatabase = True
-MgmtDestination.sqlmeta.addJoin(MultipleJoin('MgmtProducer',
joinMethodName='allProducers'))
-MgmtExchange.sqlmeta.addJoin(MultipleJoin('MgmtProducer',
joinMethodName='allProducers'))
+MintDestination.sqlmeta.addJoin(MultipleJoin('MintProducer',
joinMethodName='producers'))
+MintExchange.sqlmeta.addJoin(MultipleJoin('MintProducer',
joinMethodName='producers'))
-class MgmtConsumer(SQLObject):
+class MintConsumer(SQLObject):
schemaId = 11
schemaName = "consumer"
managedBroker = None
@@ -236,6 +236,6 @@
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"close", args=actualArgs, packageName="qpid")
- _SO_class_Mgmt_consumer_stats = None
- _SO_class_Mgmt_destination = None
- _SO_class_Mgmt_queue = None
+ _SO_class_Mint_consumer_stats = MintConsumerStats
+ _SO_class_Mint_destination = MintDestination
+ _SO_class_Mint_queue = MintQueue
Modified: mgmt/mint/python/mint/schema.sql
===================================================================
--- mgmt/mint/python/mint/schema.sql 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/mint/python/mint/schema.sql 2007-11-15 19:27:19 UTC (rev 1319)
@@ -1,33 +1,33 @@
-CREATE TABLE mgmt_system (
+CREATE TABLE mint_system (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_system_stats_id BIGINT,
+ mint_system_stats_id BIGINT,
rec_time TIMESTAMP,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
sys_ident VARCHAR(1000)
);
-CREATE INDEX mgmt_system_sys_ident_index ON mgmt_system(sys_ident);
+CREATE INDEX mint_system_sys_ident_index ON mint_system(sys_ident);
-CREATE TABLE mgmt_system_stats (
+CREATE TABLE mint_system_stats (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_system_id BIGINT REFERENCES mgmt_system ,
+ mint_system_id BIGINT REFERENCES mint_system ,
rec_time TIMESTAMP
);
-ALTER TABLE mgmt_system ADD FOREIGN KEY (mgmt_system_stats_id) REFERENCES
mgmt_system_stats;
+ALTER TABLE mint_system ADD FOREIGN KEY (mint_system_stats_id) REFERENCES
mint_system_stats;
-CREATE TABLE mgmt_broker (
+CREATE TABLE mint_broker (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_broker_stats_id BIGINT,
+ mint_broker_stats_id BIGINT,
rec_time TIMESTAMP,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
- mgmt_system_id BIGINT REFERENCES mgmt_system,
+ mint_system_id BIGINT REFERENCES mint_system,
port INT2 ,
worker_threads INT2 ,
max_conns INT2 ,
@@ -42,47 +42,47 @@
version VARCHAR(1000)
);
-CREATE INDEX mgmt_broker_port_index ON mgmt_broker(port);
+CREATE INDEX mint_broker_port_index ON mint_broker(port);
-CREATE TABLE mgmt_broker_stats (
+CREATE TABLE mint_broker_stats (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_broker_id BIGINT REFERENCES mgmt_broker ,
+ mint_broker_id BIGINT REFERENCES mint_broker ,
rec_time TIMESTAMP
);
-ALTER TABLE mgmt_broker ADD FOREIGN KEY (mgmt_broker_stats_id) REFERENCES
mgmt_broker_stats;
+ALTER TABLE mint_broker ADD FOREIGN KEY (mint_broker_stats_id) REFERENCES
mint_broker_stats;
-CREATE TABLE mgmt_vhost (
+CREATE TABLE mint_vhost (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_vhost_stats_id BIGINT,
+ mint_vhost_stats_id BIGINT,
rec_time TIMESTAMP,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
- mgmt_broker_id BIGINT REFERENCES mgmt_broker,
+ mint_broker_id BIGINT REFERENCES mint_broker,
name VARCHAR(1000)
);
-CREATE INDEX mgmt_vhost_name_index ON mgmt_vhost(name);
+CREATE INDEX mint_vhost_name_index ON mint_vhost(name);
-CREATE TABLE mgmt_vhost_stats (
+CREATE TABLE mint_vhost_stats (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_vhost_id BIGINT REFERENCES mgmt_vhost ,
+ mint_vhost_id BIGINT REFERENCES mint_vhost ,
rec_time TIMESTAMP
);
-ALTER TABLE mgmt_vhost ADD FOREIGN KEY (mgmt_vhost_stats_id) REFERENCES
mgmt_vhost_stats;
+ALTER TABLE mint_vhost ADD FOREIGN KEY (mint_vhost_stats_id) REFERENCES
mint_vhost_stats;
-CREATE TABLE mgmt_queue (
+CREATE TABLE mint_queue (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_queue_stats_id BIGINT,
+ mint_queue_stats_id BIGINT,
rec_time TIMESTAMP,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
- mgmt_vhost_id BIGINT REFERENCES mgmt_vhost,
+ mint_vhost_id BIGINT REFERENCES mint_vhost,
name VARCHAR(1000) ,
durable BOOLEAN ,
auto_delete BOOLEAN ,
@@ -90,12 +90,12 @@
page_memory_limit INT4
);
-CREATE INDEX mgmt_queue_name_index ON mgmt_queue(name);
+CREATE INDEX mint_queue_name_index ON mint_queue(name);
-CREATE TABLE mgmt_queue_stats (
+CREATE TABLE mint_queue_stats (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_queue_id BIGINT REFERENCES mgmt_queue ,
+ mint_queue_id BIGINT REFERENCES mint_queue ,
rec_time TIMESTAMP,
disk_page_size INT4 ,
disk_pages INT4 ,
@@ -141,26 +141,26 @@
unacked_messages_low INT4
);
-ALTER TABLE mgmt_queue ADD FOREIGN KEY (mgmt_queue_stats_id) REFERENCES
mgmt_queue_stats;
+ALTER TABLE mint_queue ADD FOREIGN KEY (mint_queue_stats_id) REFERENCES
mint_queue_stats;
-CREATE TABLE mgmt_exchange (
+CREATE TABLE mint_exchange (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_exchange_stats_id BIGINT,
+ mint_exchange_stats_id BIGINT,
rec_time TIMESTAMP,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
- mgmt_vhost_id BIGINT REFERENCES mgmt_vhost,
+ mint_vhost_id BIGINT REFERENCES mint_vhost,
name VARCHAR(1000) ,
type VARCHAR(1000)
);
-CREATE INDEX mgmt_exchange_name_index ON mgmt_exchange(name);
+CREATE INDEX mint_exchange_name_index ON mint_exchange(name);
-CREATE TABLE mgmt_exchange_stats (
+CREATE TABLE mint_exchange_stats (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_exchange_id BIGINT REFERENCES mgmt_exchange ,
+ mint_exchange_id BIGINT REFERENCES mint_exchange ,
rec_time TIMESTAMP,
producers INT4 ,
producers_high INT4 ,
@@ -176,50 +176,50 @@
byte_routes INT8
);
-ALTER TABLE mgmt_exchange ADD FOREIGN KEY (mgmt_exchange_stats_id) REFERENCES
mgmt_exchange_stats;
+ALTER TABLE mint_exchange ADD FOREIGN KEY (mint_exchange_stats_id) REFERENCES
mint_exchange_stats;
-CREATE TABLE mgmt_binding (
+CREATE TABLE mint_binding (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_binding_stats_id BIGINT,
+ mint_binding_stats_id BIGINT,
rec_time TIMESTAMP,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
- mgmt_queue_id BIGINT REFERENCES mgmt_queue,
- mgmt_exchange_id BIGINT REFERENCES mgmt_exchange,
+ mint_queue_id BIGINT REFERENCES mint_queue,
+ mint_exchange_id BIGINT REFERENCES mint_exchange,
binding_key VARCHAR(1000)
);
-CREATE TABLE mgmt_binding_stats (
+CREATE TABLE mint_binding_stats (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_binding_id BIGINT REFERENCES mgmt_binding ,
+ mint_binding_id BIGINT REFERENCES mint_binding ,
rec_time TIMESTAMP,
msg_matched INT8
);
-ALTER TABLE mgmt_binding ADD FOREIGN KEY (mgmt_binding_stats_id) REFERENCES
mgmt_binding_stats;
+ALTER TABLE mint_binding ADD FOREIGN KEY (mint_binding_stats_id) REFERENCES
mint_binding_stats;
-CREATE TABLE mgmt_client (
+CREATE TABLE mint_client (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_client_stats_id BIGINT,
+ mint_client_stats_id BIGINT,
rec_time TIMESTAMP,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
- mgmt_vhost_id BIGINT REFERENCES mgmt_vhost,
+ mint_vhost_id BIGINT REFERENCES mint_vhost,
ip_addr INT4 ,
port INT2
);
-CREATE INDEX mgmt_client_ip_addr_index ON mgmt_client(ip_addr);
+CREATE INDEX mint_client_ip_addr_index ON mint_client(ip_addr);
-CREATE INDEX mgmt_client_port_index ON mgmt_client(port);
+CREATE INDEX mint_client_port_index ON mint_client(port);
-CREATE TABLE mgmt_client_stats (
+CREATE TABLE mint_client_stats (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_client_id BIGINT REFERENCES mgmt_client ,
+ mint_client_id BIGINT REFERENCES mint_client ,
rec_time TIMESTAMP,
auth_identity VARCHAR(1000) ,
msgs_produced INT8 ,
@@ -228,52 +228,52 @@
bytes_consumed INT8
);
-ALTER TABLE mgmt_client ADD FOREIGN KEY (mgmt_client_stats_id) REFERENCES
mgmt_client_stats;
+ALTER TABLE mint_client ADD FOREIGN KEY (mint_client_stats_id) REFERENCES
mint_client_stats;
-CREATE TABLE mgmt_session (
+CREATE TABLE mint_session (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_session_stats_id BIGINT,
+ mint_session_stats_id BIGINT,
rec_time TIMESTAMP,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
- mgmt_vhost_id BIGINT REFERENCES mgmt_vhost,
+ mint_vhost_id BIGINT REFERENCES mint_vhost,
name VARCHAR(1000) ,
- mgmt_client_id BIGINT REFERENCES mgmt_client,
+ mint_client_id BIGINT REFERENCES mint_client,
detached_lifespan INT4
);
-CREATE INDEX mgmt_session_name_index ON mgmt_session(name);
+CREATE INDEX mint_session_name_index ON mint_session(name);
-CREATE TABLE mgmt_session_stats (
+CREATE TABLE mint_session_stats (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_session_id BIGINT REFERENCES mgmt_session ,
+ mint_session_id BIGINT REFERENCES mint_session ,
rec_time TIMESTAMP,
attached BOOLEAN ,
remaining_lifespan INT4 ,
frames_outstanding INT4
);
-ALTER TABLE mgmt_session ADD FOREIGN KEY (mgmt_session_stats_id) REFERENCES
mgmt_session_stats;
+ALTER TABLE mint_session ADD FOREIGN KEY (mint_session_stats_id) REFERENCES
mint_session_stats;
-CREATE TABLE mgmt_destination (
+CREATE TABLE mint_destination (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_destination_stats_id BIGINT,
+ mint_destination_stats_id BIGINT,
rec_time TIMESTAMP,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
- mgmt_session_id BIGINT REFERENCES mgmt_session,
+ mint_session_id BIGINT REFERENCES mint_session,
name VARCHAR(1000)
);
-CREATE INDEX mgmt_destination_name_index ON mgmt_destination(name);
+CREATE INDEX mint_destination_name_index ON mint_destination(name);
-CREATE TABLE mgmt_destination_stats (
+CREATE TABLE mint_destination_stats (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_destination_id BIGINT REFERENCES mgmt_destination ,
+ mint_destination_id BIGINT REFERENCES mint_destination ,
rec_time TIMESTAMP,
flow_mode INT2 ,
max_msg_credits INT4 ,
@@ -282,45 +282,45 @@
byte_credits INT4
);
-ALTER TABLE mgmt_destination ADD FOREIGN KEY (mgmt_destination_stats_id) REFERENCES
mgmt_destination_stats;
+ALTER TABLE mint_destination ADD FOREIGN KEY (mint_destination_stats_id) REFERENCES
mint_destination_stats;
-CREATE TABLE mgmt_producer (
+CREATE TABLE mint_producer (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_producer_stats_id BIGINT,
+ mint_producer_stats_id BIGINT,
rec_time TIMESTAMP,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
- mgmt_destination_id BIGINT REFERENCES mgmt_destination,
- mgmt_exchange_id BIGINT REFERENCES mgmt_exchange
+ mint_destination_id BIGINT REFERENCES mint_destination,
+ mint_exchange_id BIGINT REFERENCES mint_exchange
);
-CREATE TABLE mgmt_producer_stats (
+CREATE TABLE mint_producer_stats (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_producer_id BIGINT REFERENCES mgmt_producer ,
+ mint_producer_id BIGINT REFERENCES mint_producer ,
rec_time TIMESTAMP,
msgs_produced INT8 ,
bytes_produced INT8
);
-ALTER TABLE mgmt_producer ADD FOREIGN KEY (mgmt_producer_stats_id) REFERENCES
mgmt_producer_stats;
+ALTER TABLE mint_producer ADD FOREIGN KEY (mint_producer_stats_id) REFERENCES
mint_producer_stats;
-CREATE TABLE mgmt_consumer (
+CREATE TABLE mint_consumer (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_consumer_stats_id BIGINT,
+ mint_consumer_stats_id BIGINT,
rec_time TIMESTAMP,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
- mgmt_destination_id BIGINT REFERENCES mgmt_destination,
- mgmt_queue_id BIGINT REFERENCES mgmt_queue
+ mint_destination_id BIGINT REFERENCES mint_destination,
+ mint_queue_id BIGINT REFERENCES mint_queue
);
-CREATE TABLE mgmt_consumer_stats (
+CREATE TABLE mint_consumer_stats (
id BIGSERIAL PRIMARY KEY,
id_original BIGINT,
- mgmt_consumer_id BIGINT REFERENCES mgmt_consumer ,
+ mint_consumer_id BIGINT REFERENCES mint_consumer ,
rec_time TIMESTAMP,
msgs_consumed INT8 ,
bytes_consumed INT8 ,
@@ -329,4 +329,4 @@
unacked_messages_low INT4
);
-ALTER TABLE mgmt_consumer ADD FOREIGN KEY (mgmt_consumer_stats_id) REFERENCES
mgmt_consumer_stats;
+ALTER TABLE mint_consumer ADD FOREIGN KEY (mint_consumer_stats_id) REFERENCES
mint_consumer_stats;
Modified: mgmt/mint/schemaparser.py
===================================================================
--- mgmt/mint/schemaparser.py 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/mint/schemaparser.py 2007-11-15 19:27:19 UTC (rev 1319)
@@ -204,5 +204,5 @@
pythonFile.close()
-# parser = SchemaParser()
-# parser.generateCode()
+parser = SchemaParser()
+parser.generateCode()
Modified: mgmt/misc/mint-test.py
===================================================================
--- mgmt/misc/mint-test.py 2007-11-15 16:11:21 UTC (rev 1318)
+++ mgmt/misc/mint-test.py 2007-11-15 19:27:19 UTC (rev 1319)
@@ -13,10 +13,10 @@
def getQueueByName(name, create=False):
try:
- queues = MgmtQueue.selectBy(name=name)[:1]
+ queues = MintQueue.selectBy(name=name)[:1]
queue = queues[0]
except IndexError:
- if (create): queue = MgmtQueue()
+ if (create): queue = MintQueue()
return queue
def configCallback(broker, oid, list, timestamps):