Author: justi9
Date: 2007-11-16 14:55:33 -0500 (Fri, 16 Nov 2007)
New Revision: 1327
Modified:
mgmt/cumin/bin/cumin-test
mgmt/cumin/python/cumin/__init__.py
mgmt/cumin/python/cumin/demo.py
mgmt/cumin/python/cumin/measurement.py
mgmt/cumin/python/cumin/measurement.strings
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/python/cumin/widgets.py
Log:
Big overhaul of model metadata in preparation for mint model
integration. UI metadata is now handled in a parallel set of
CuminClasses, one for each mint class.
Uses this metadata to generate xml for queue ajax.
Modified: mgmt/cumin/bin/cumin-test
===================================================================
--- mgmt/cumin/bin/cumin-test 2007-11-16 19:53:44 UTC (rev 1326)
+++ mgmt/cumin/bin/cumin-test 2007-11-16 19:55:33 UTC (rev 1327)
@@ -67,7 +67,7 @@
from cumin.model import *
def do_main(port, broker, bench_hits, debug=True, demodata=True):
- model = CuminModel()
+ model = DummyModel()
app = Cumin(model)
if broker:
Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2007-11-16 19:53:44 UTC (rev 1326)
+++ mgmt/cumin/python/cumin/__init__.py 2007-11-16 19:55:33 UTC (rev 1327)
@@ -10,7 +10,7 @@
from mint.schema import *
from sqlobject.main import *
-from model import CuminModel
+from model import DummyModel, CuminModel
from demo import DemoData
from page import CuminPage
from queue import QueueXmlPage, QueueChartPage
@@ -29,6 +29,7 @@
self.add_resource_dir(os.path.join(self.home, "resources"))
self.model = model
+ self.cmodel = CuminModel()
self.mint = MintModel()
@@ -60,7 +61,7 @@
class CuminServer(WebServer):
def __init__(self, port=9090):
- model = CuminModel()
+ model = DummyModel()
data = DemoData(model)
data.load()
Modified: mgmt/cumin/python/cumin/demo.py
===================================================================
--- mgmt/cumin/python/cumin/demo.py 2007-11-16 19:53:44 UTC (rev 1326)
+++ mgmt/cumin/python/cumin/demo.py 2007-11-16 19:55:33 UTC (rev 1327)
@@ -174,7 +174,7 @@
def frob(self, mobject):
mobject.lock()
try:
- if isinstance(mobject, CuminModelObject):
+ if isinstance(mobject, DummyModelObject):
for measure in mobject.measurements:
self.frob_measure(measure)
@@ -240,7 +240,7 @@
if __name__ == "__main__":
import sys
- model = CuminModel()
+ model = DummyModel()
data = DemoData(model)
data.load()
Modified: mgmt/cumin/python/cumin/measurement.py
===================================================================
--- mgmt/cumin/python/cumin/measurement.py 2007-11-16 19:53:44 UTC (rev 1326)
+++ mgmt/cumin/python/cumin/measurement.py 2007-11-16 19:55:33 UTC (rev 1327)
@@ -9,205 +9,6 @@
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"
@@ -222,52 +23,46 @@
self.add_attribute(self.object);
def get_items(self, session, object):
- self.object.set(session, object);
+ stats = list()
+ cls = self.app.cmodel.get_class(object)
- 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))
+ for stat in cls.stats:
+ if self.category in stat.categories:
+ stats.append((stat, object))
- return measures
+ return stats
def render_item_title(self, session, args):
- measure, stats = args
- return measure.title
+ stat, object = args
+ return stat.title
def render_item_name(self, session, args):
- measure, stats = args
- return measure.name
+ stat, object = args
+ return stat.name
def render_item_value(self, session, args):
- measure, stats = args
+ stat, object = args
- if measure.link_cb:
+ if stat.link_cb:
branch = session.branch()
- measure.link_cb(self.page(), branch, self.object.get(session))
- return fmt_link(branch.marshal(), measure.get(stats))
+ stat.link_cb(self.page(), branch, object)
+ return fmt_link(branch.marshal(), stat.value(object))
else:
- return measure.get(stats)
+ return stat.value(object)
- def render_item_extra(self, session, measure):
+ def render_item_extra(self, session, args):
+ stat, object = args
+
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)
+ if stat.highlow:
+ return
"<small>high</small> <span>%i</span> " + \
+
"<small>low</small> <span>%i</span>" \
+ % (stat.high(object) or 0, stat.low(object) or 0)
else:
- unit = self.unit_abbrevs.get(measure.unit, measure.unit)
- return fmt_rate(measure.get_rate(), unit, "sec")
+ unit = self.unit_abbrevs.get(stat.unit, stat.unit)
+ return fmt_rate(stat.rate(object), unit, "sec")
- def render_item_average(self, session, measure):
+ def render_item_average(self, session, args):
+ stat, object = args
return None #XXX "%0.2f" % (sum(measure.values) /
float(len(measure.values)))
Modified: mgmt/cumin/python/cumin/measurement.strings
===================================================================
--- mgmt/cumin/python/cumin/measurement.strings 2007-11-16 19:53:44 UTC (rev 1326)
+++ mgmt/cumin/python/cumin/measurement.strings 2007-11-16 19:55:33 UTC (rev 1327)
@@ -5,13 +5,13 @@
var tr = trs.next();
while (tr) {
- var attr = tr.getattr("m");
+ var attr = tr.getattr("stat");
if (attr) {
- var m = object.measurement[attr];
+ var stat = object.stat[attr];
var tds = tr.elems("td", null, null, 0, 2);
- tds.next().text().set(m.value);
+ tds.next().text().set(stat.value);
var td = tds.next();
@@ -19,13 +19,13 @@
var ph = phs.next();
if (ph) {
- ph.set(m.high);
+ ph.set(stat.high);
ph = phs.next();
- ph.set(m.low);
+ ph.set(stat.low);
} else {
- td.text().set(m.rate);
+ td.text().set(stat.rate);
}
}
@@ -45,8 +45,8 @@
</table>
[MeasurementSet.item_html]
-<tr m="{item_name}">
+<tr stat="{item_name}">
<th>{item_title}</th>
- <td class="ralign">{item_value}</td>
- <td class="ralign">{item_extra}</td>
+ <td class="ralign"> {item_value}</td>
+ <td class="ralign"> {item_extra}</td>
</tr>
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-16 19:53:44 UTC (rev 1326)
+++ mgmt/cumin/python/cumin/model.py 2007-11-16 19:55:33 UTC (rev 1327)
@@ -1,10 +1,271 @@
+from mint.schema import *
from wooly import *
from wooly.model import *
-class CuminModel(Model):
+class CuminModel(object):
def __init__(self):
- super(CuminModel, self).__init__()
+ self.classes = dict()
+ self.queue = CuminQueue()
+ self.add_class(self.queue)
+
+ def add_class(self, cls):
+ self.classes[cls.mint_class] = cls
+
+ def get_class(self, mint_object):
+ return self.classes[mint_object.__class__]
+
+class CuminClass(object):
+ def __init__(self, mint_class):
+ self.mint_class = mint_class
+
+ self.stats = list()
+
+ def add_stat(self, stat):
+ self.stats.append(stat)
+
+ def get_stat(self, name):
+ for stat in self.stats:
+ if stat.name == name:
+ return stat
+
+ def write_error_xml(self, object, writer):
+ writer.write("<error-count>%i</error-count>" % 0)
+ writer.write("<warning-count>%i</warning-count>" % 0)
+
+ def write_stat_xml(self, object, writer):
+ for stat in self.stats:
+ stat.write_xml(object, writer)
+
+class CuminStat(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 stats(self, object):
+ if isinstance(object, MintQueue):
+ stats = object.mintQueueStats
+ elif isinstance(object, MintExchange):
+ stats = object.mintExchangeStats
+ elif isinstance(object, MintClient):
+ stats = object.mintClientStats
+ else:
+ raise Exception()
+
+ return stats
+
+ def value(self, object):
+ return getattr(self.stats(object), self.name)
+
+ def rate(self, object):
+ return getattr(self.stats(object), self.name)
+
+ def write_xml(self, object, writer):
+ writer.write("<stat name=\"%s\" value=\"%i\"
rate=\"%i\"/>" \
+ % (self.name,
+ self.value(object) or 0,
+ self.rate(object) or 0))
+
+class CuminQueue(CuminClass):
+ def __init__(self):
+ super(CuminQueue, self).__init__(MintQueue)
+
+ stat = CuminStat("consumers", "int")
+ stat.title = "Consumers"
+ stat.unit = "consumer"
+ stat.categories = ("general")
+ stat.highlow = True
+ self.add_stat(stat)
+
+ stat = CuminStat("bindings", "int")
+ stat.title = "Bindings"
+ stat.unit = "binding"
+ stat.categories = ("general")
+ stat.highlow = True
+ self.add_stat(stat)
+
+ stat = CuminStat("msgDepth", "int")
+ stat.title = "Message Depth"
+ stat.unit = "message"
+ stat.categories = ("message", "general")
+ stat.highlow = True
+ self.add_stat(stat)
+
+ stat = CuminStat("msgTotalEnqueues", "int")
+ stat.title = "Msgs. Enqueued"
+ stat.unit = "message"
+ stat.categories = ("message", "general")
+ self.add_stat(stat)
+
+ stat = CuminStat("msgTotalDequeues", "int")
+ stat.title = "Msgs. Dequeued"
+ stat.unit = "message"
+ stat.categories = ("message", "general")
+ self.add_stat(stat)
+
+ stat = CuminStat("byteDepth", "int")
+ stat.title = "Byte Depth"
+ stat.unit = "byte"
+ stat.categories = ("byte", "general")
+ stat.highlow = True
+ self.add_stat(stat)
+
+ stat = CuminStat("byteTotalEnqueues", "int")
+ stat.title = "Bytes Enqueued"
+ stat.unit = "byte"
+ stat.categories = ("byte", "general")
+ self.add_stat(stat)
+
+ stat = CuminStat("byteTotalDequeues", "int")
+ stat.title = "Bytes Dequeued"
+ stat.unit = "byte"
+ stat.categories = ("byte", "general")
+ self.add_stat(stat)
+
+ stat = CuminStat("unackedMessages", "int")
+ stat.title = "Msgs. Unacked"
+ stat.unit = "message"
+ stat.categories = ("general")
+ self.add_stat(stat)
+
+ # Disk
+
+ #stat = CuminStat("diskPageSize", "int")
+ #stat.title = "Page size"
+ #stat.categories = ("disk")
+ #self.add_stat(stat)
+
+ stat = CuminStat("diskPages", "int")
+ stat.title = "Disk Pages"
+ stat.unit = "page"
+ stat.categories = ("general")
+ self.add_stat(stat)
+
+ #stat = CuminStat("diskAvailableSize", "int")
+ #stat.title = "Available size"
+ #stat.categories = ("disk")
+ #self.add_stat(stat)
+
+ # Transactional
+
+ stat = CuminStat("msgTxnEnqueues", "int")
+ stat.title = "Msgs. Enqueued"
+ stat.unit = "message"
+ stat.categories = ("message", "transactional")
+ self.add_stat(stat)
+
+ stat = CuminStat("msgTxnDequeues", "int")
+ stat.title = "Msgs. Dequeued"
+ stat.unit = "message"
+ stat.categories = ("message", "transactional")
+ self.add_stat(stat)
+
+ stat = CuminStat("byteTxnEnqueues", "int")
+ stat.title = "Bytes Enqueued"
+ stat.unit = "byte"
+ stat.categories = ("byte", "transactional")
+ self.add_stat(stat)
+
+ stat = CuminStat("byteTxnDequeues", "int")
+ stat.title = "Bytes Dequeued"
+ stat.unit = "byte"
+ stat.categories = ("byte", "transactional")
+ self.add_stat(stat)
+
+ stat = CuminStat("enqueueTxnStarts", "int")
+ stat.title = "Enq. Trans. Started"
+ stat.unit = "transaction"
+ stat.categories = ("transaction")
+ self.add_stat(stat)
+
+ stat = CuminStat("enqueueTxnCommits", "int")
+ stat.title = "Enq. Trans. Committed"
+ stat.unit = "transaction"
+ stat.categories = ("transaction")
+ self.add_stat(stat)
+
+ stat = CuminStat("enqueueTxnRejects", "int")
+ stat.title = "Enq. Trans. Rejected"
+ stat.unit = "transaction"
+ stat.categories = ("transaction")
+ self.add_stat(stat)
+
+ stat = CuminStat("enqueueTxnCount", "int")
+ stat.title = "Enq. Trans. Pending"
+ stat.unit = "transaction"
+ stat.categories = ("transaction")
+ stat.highlow = True
+ self.add_stat(stat)
+
+ stat = CuminStat("dequeueTxnStarts", "int")
+ stat.title = "Deq. Trans. Started"
+ stat.unit = "transaction"
+ stat.categories = ("transaction")
+ self.add_stat(stat)
+
+ stat = CuminStat("dequeueTxnCommits", "int")
+ stat.title = "Deq. Trans. Committed"
+ stat.unit = "transaction"
+ stat.categories = ("transaction")
+ self.add_stat(stat)
+
+ stat = CuminStat("dequeueTxnRejects", "int")
+ stat.title = "Deq. Trans. Rejected"
+ stat.unit = "transaction"
+ stat.categories = ("transaction")
+ self.add_stat(stat)
+
+ stat = CuminStat("dequeueTxnCount", "int")
+ stat.title = "Deq. Trans. Pending"
+ stat.unit = "transaction"
+ stat.categories = ("transaction")
+ stat.highlow = True
+ self.add_stat(stat)
+
+ # Persistent
+
+ stat = CuminStat("msgPersistEnqueues", "int")
+ stat.title = "Msgs. Enqueued"
+ stat.unit = "message"
+ stat.categories = ("message", "persistent")
+ self.add_stat(stat)
+
+ stat = CuminStat("msgPersistDequeues", "int")
+ stat.title = "Msgs. Dequeued"
+ stat.unit = "message"
+ stat.categories = ("message", "persistent")
+ self.add_stat(stat)
+
+ stat = CuminStat("bytePersistEnqueues", "int")
+ stat.title = "Bytes Enqueued"
+ stat.unit = "byte"
+ stat.categories = ("byte", "persistent")
+ self.add_stat(stat)
+
+ stat = CuminStat("bytePersistDequeues", "int")
+ stat.title = "Bytes Dequeued"
+ stat.unit = "byte"
+ stat.categories = ("byte", "persistent")
+ self.add_stat(stat)
+
+ def write_xml(self, queue, writer):
+ writer.write("<queue id=\"%i\">" % queue.id)
+ writer.write("<name>%s</name>" % queue.name)
+
+ self.write_error_xml(queue, writer)
+ self.write_stat_xml(queue, writer)
+
+ writer.write("</queue>")
+
+class DummyModel(Model):
+ def __init__(self):
+ super(DummyModel, self).__init__()
+
self.broker = ModelClass(self, "broker")
self.broker_cluster = ModelClass(self, "broker_cluster")
self.broker_profile = ModelClass(self, "broker_profile")
@@ -175,9 +436,9 @@
def get_realm(self, id):
return self.get_index(self.realm).get(id)
-class CuminModelObject(ModelObject):
+class DummyModelObject(ModelObject):
def __init__(self, model, mclass):
- super(CuminModelObject, self).__init__(model, mclass)
+ super(DummyModelObject, self).__init__(model, mclass)
self.errors = list()
self.warnings = list()
@@ -196,13 +457,13 @@
for measure in self.measurements:
measure.write_xml(writer)
-class BrokerCluster(CuminModelObject):
+class BrokerCluster(DummyModelObject):
def __init__(self, model):
super(BrokerCluster, self).__init__(model, model.broker_cluster)
self.name = None
-class Broker(CuminModelObject):
+class Broker(DummyModelObject):
def __init__(self, model):
super(Broker, self).__init__(model, model.broker)
@@ -222,7 +483,7 @@
writer.write("</broker>")
-class BrokerProfile(CuminModelObject):
+class BrokerProfile(DummyModelObject):
def __init__(self, model):
super(BrokerProfile, self).__init__(model, model.broker_profile)
@@ -237,7 +498,7 @@
self.broker_value = None
self.type = None # ("boolean", "integer",
"string")
-class BrokerGroup(CuminModelObject):
+class BrokerGroup(DummyModelObject):
def __init__(self, model):
super(BrokerGroup, self).__init__(model, model.broker_group)
@@ -249,7 +510,7 @@
self.name = None
-class VirtualHost(CuminModelObject):
+class VirtualHost(DummyModelObject):
def __init__(self, model):
super(VirtualHost, self).__init__(model, model.virtual_host)
@@ -297,7 +558,7 @@
self.name = None
-class Realm(CuminModelObject):
+class Realm(DummyModelObject):
def __init__(self, model):
super(Realm, self).__init__(model, model.realm)
@@ -391,7 +652,7 @@
writer.write("<measurement name=\"%s\" value=\"%i\"
rate=\"%i\" %s/>" \
% (self.name, self.get_value(), self.get_rate(), hl))
-class Queue(CuminModelObject):
+class Queue(DummyModelObject):
def __init__(self, model):
super(Queue, self).__init__(model, model.queue)
@@ -600,7 +861,7 @@
writer.write("</queue>")
-class Consumer(CuminModelObject):
+class Consumer(DummyModelObject):
def __init__(self, model):
super(Consumer, self).__init__(model, model.consumer)
@@ -625,7 +886,7 @@
measure.highlow = True
self.measurements.append(measure)
-class Exchange(CuminModelObject):
+class Exchange(DummyModelObject):
def __init__(self, model):
super(Exchange, self).__init__(model, model.exchange)
@@ -701,7 +962,7 @@
writer.write("</exchange>")
-class Producer(CuminModelObject):
+class Producer(DummyModelObject):
def __init__(self, model):
super(Producer, self).__init__(model, model.producer)
@@ -717,7 +978,7 @@
measure.categories = ("byte", "general")
self.measurements.append(measure)
-class Binding(CuminModelObject):
+class Binding(DummyModelObject):
def __init__(self, model):
super(Binding, self).__init__(model, model.binding)
@@ -739,7 +1000,7 @@
writer.write("</binding>")
-class Client(CuminModelObject):
+class Client(DummyModelObject):
def __init__(self, model):
super(Client, self).__init__(model, model.client)
@@ -774,7 +1035,7 @@
writer.write("</client>")
-class Session(CuminModelObject):
+class Session(DummyModelObject):
def __init__(self, model):
super(Session, self).__init__(model, model.session)
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-16 19:53:44 UTC (rev 1326)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-16 19:55:33 UTC (rev 1327)
@@ -92,18 +92,18 @@
function updateQueueStatus(id, queue) {
updateStatus(id, queue);
- var m = queue.measurement;
- var mdata = {
+ var s = queue.stat;
+ var sdata = {
"tr": [
null,
- {"td": [m.msgTotalEnqueues.rate, m.byteTotalEnqueues.rate]},
- {"td": [m.msgTotalDequeues.rate, m.byteTotalDequeues.rate]},
- {"td": [m.msgDepth.value, m.byteDepth.value]},
- {"td": [m.msgDepth.rate, m.byteDepth.rate]}
+ {"td": [s.msgTotalEnqueues.rate, s.byteTotalEnqueues.rate]},
+ {"td": [s.msgTotalDequeues.rate, s.byteTotalDequeues.rate]},
+ {"td": [s.msgDepth.value, s.byteDepth.value]},
+ {"td": [s.msgDepth.rate, s.byteDepth.rate]}
]
};
- wooly.doc().elembyid(id).descendant("table.tbody").update(mdata);
+ wooly.doc().elembyid(id).descendant("table.tbody").update(sdata);
}
[QueueStatus.html]
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2007-11-16 19:53:44 UTC (rev 1326)
+++ mgmt/cumin/python/cumin/widgets.py 2007-11-16 19:55:33 UTC (rev 1327)
@@ -199,7 +199,8 @@
writer.write("<objects>");
for object in objects:
- object.write_xml(writer)
+ cls = self.app.cmodel.get_class(object)
+ cls.write_xml(object, writer)
writer.write("</objects>");