Author: justi9
Date: 2007-11-20 15:22:42 -0500 (Tue, 20 Nov 2007)
New Revision: 1342
Added:
mgmt/cumin/resources/action-20.png
mgmt/cumin/resources/action-36.png
mgmt/cumin/resources/broker-20.png
mgmt/cumin/resources/broker-36.png
mgmt/cumin/resources/client-20.png
mgmt/cumin/resources/client-36.png
mgmt/cumin/resources/cluster-20.png
mgmt/cumin/resources/cluster-36.png
mgmt/cumin/resources/profile-20.png
mgmt/cumin/resources/profile-36.png
mgmt/cumin/resources/system-20.png
mgmt/cumin/resources/system-36.png
Modified:
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/broker.strings
mgmt/cumin/python/cumin/brokercluster.py
mgmt/cumin/python/cumin/brokercluster.strings
mgmt/cumin/python/cumin/brokergroup.py
mgmt/cumin/python/cumin/brokerprofile.strings
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/client.strings
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/exchange.strings
mgmt/cumin/python/cumin/formats.py
mgmt/cumin/python/cumin/measurement.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/queue.strings
mgmt/cumin/resources/exchange-20.png
mgmt/cumin/resources/exchange-36.png
mgmt/cumin/resources/queue-20.png
mgmt/cumin/resources/queue-36.png
Log:
Adds newest icons.
Updates name formatter.
More fixups for data model integration.
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/broker.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -58,7 +58,7 @@
return fmt_none()
def render_item_status(self, session, broker):
- return None #fmt_status(len(broker.errors), len(broker.warnings))
+ return fmt_ostatus(broker)
def render_item_load(self, session, broker):
return "%.2f" % random()
Modified: mgmt/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/cumin/python/cumin/broker.strings 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/broker.strings 2007-11-20 20:22:42 UTC (rev 1342)
@@ -144,7 +144,7 @@
[BrokerView.html]
{status}
-<h1>{title}</h1>
+<h1><img src="resource?name=broker-36.png"/>{title}</h1>
<table class="props">
<tr><th>Name</th><td>{name}</td></tr>
Modified: mgmt/cumin/python/cumin/brokercluster.py
===================================================================
--- mgmt/cumin/python/cumin/brokercluster.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/brokercluster.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -37,7 +37,7 @@
writer = Writer()
for broker in sorted_by(cluster.broker_items()):
- writer.write(fmt_status(len(broker.errors), len(broker.warnings)))
+ writer.write(fmt_ostatus(broker))
return writer.to_string()
Modified: mgmt/cumin/python/cumin/brokercluster.strings
===================================================================
--- mgmt/cumin/python/cumin/brokercluster.strings 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/brokercluster.strings 2007-11-20 20:22:42 UTC (rev 1342)
@@ -40,7 +40,7 @@
[BrokerClusterView.html]
{status}
-<h1>{title}</h1>
+<h1><img src="resource?name=cluster-36.png"/>{title}</h1>
<table class="props">
<tr><th>Name</th><td>{name}</td></tr>
Modified: mgmt/cumin/python/cumin/brokergroup.py
===================================================================
--- mgmt/cumin/python/cumin/brokergroup.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/brokergroup.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -35,7 +35,7 @@
writer = Writer()
for broker in sorted_by(group.broker_items()):
- writer.write(fmt_status(len(broker.errors), len(broker.warnings)))
+ writer.write(fmt_ostatus(broker))
return writer.to_string()
Modified: mgmt/cumin/python/cumin/brokerprofile.strings
===================================================================
--- mgmt/cumin/python/cumin/brokerprofile.strings 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/brokerprofile.strings 2007-11-20 20:22:42 UTC (rev 1342)
@@ -17,7 +17,7 @@
</tr>
[BrokerProfileView.html]
-<h1>{title}</h1>
+<h1><img src="resource?name=profile-36.png"/> {title}</h1>
<table class="props">
<tr><th>Name</th><td>{name}</td></tr>
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/client.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -49,7 +49,7 @@
return fmt_rate(value, unit == "b" and "byte" or
"msg", "sec")
def render_item_status(self, session, client):
- return None #XXX fmt_status(len(client.errors), len(client.warnings))
+ return fmt_ostatus(client)
class ClientFrame(CuminFrame):
def __init__(self, app, name):
@@ -172,7 +172,7 @@
return fmt_predicate(value)
def render_item_status(self, session, session_):
- return None #XXX fmt_status(len(session_.errors), len(session_.warnings))
+ return fmt_ostatus(session_)
class ClientXmlPage(CuminXmlPage):
def __init__(self, app, name):
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/client.strings 2007-11-20 20:22:42 UTC (rev 1342)
@@ -98,7 +98,7 @@
{status}
-<h1>{title}</h1>
+<h1><img src="client-36.png"/>{title}</h1>
<table class="props">
<tr><th>Address</th><td>{address}</td></tr>
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/exchange.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -83,7 +83,7 @@
return getattr(exchange.mintExchangeStats, key)
def render_item_status(self, session, exchange):
- return None #XXX fmt_status(len(exchange.errors), len(exchange.warnings))
+ return fmt_ostatus(exchange)
def show_producers(page, session, exchange):
frame = page.show_exchange(session, exchange).show_view(session)
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/exchange.strings 2007-11-20 20:22:42 UTC (rev 1342)
@@ -154,7 +154,7 @@
{status}
-<h1><img src="resource?name=exchange-36.png"> {title}</h1>
+<h1><img src="resource?name=exchange-36.png"/>{title}</h1>
<table class="props">
<tr><th>Name</th><td>{name}</td></tr>
Modified: mgmt/cumin/python/cumin/formats.py
===================================================================
--- mgmt/cumin/python/cumin/formats.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/formats.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -30,7 +30,7 @@
def fmt_rate(value, unit1, unit2):
#return "%i <small>%s/%s</small>" % (value, unit1, unit2)
- return "%i<small>/%s</small>" % (value, unit2)
+ return "%i<small>/%s</small>" % (nvl(value, 0), unit2)
def fmt_predicate(predicate):
return predicate and "Yes" or "No"
@@ -55,12 +55,17 @@
return "<div class=\"statuslight %s\">%s</div>" %
(class_, number)
+def fmt_ostatus(object):
+ return fmt_status(0, 0)
+
def fmt_none():
return "<span class=\"none\">None</span>"
def fmt_shorten(string):
if len(string) > 15:
return string[:10] + "..." + string[-5:]
+ else:
+ return string
def fmt_link(href, content, class_=""):
return "<a href=\"%s\"%s>%s</a>" % \
Modified: mgmt/cumin/python/cumin/measurement.py
===================================================================
--- mgmt/cumin/python/cumin/measurement.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/measurement.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -53,9 +53,7 @@
def render_item_extra(self, session, args):
stat, object = args
- return None #XXX
-
- if stat.highlow:
+ if False and stat.highlow: #XXX
return
"<small>high</small> <span>%i</span> " + \
"<small>low</small> <span>%i</span>" \
% (stat.high(object) or 0, stat.low(object) or 0)
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/model.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -51,8 +51,15 @@
return getattr(object.stats, self.name)
def rate(self, object):
- return getattr(object.stats, self.name)
+ if object.stats:
+ curr = getattr(object.stats, self.name)
+ if object.statsPrev:
+ prev = getattr(object.statsPrev, self.name)
+
+ if curr is not None and prev is not None:
+ return (curr - prev) / float(1)
+
def write_xml(self, object, writer):
writer.write("<stat name=\"%s\" value=\"%i\"
rate=\"%i\"/>" \
% (self.name,
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-20 20:22:42 UTC (rev 1342)
@@ -77,7 +77,7 @@
return fmt_rate(value, unit == "b" and "byte" or
"msg", "sec")
def render_item_status(self, session, queue):
- return None #fmt_status(len(queue.errors), len(queue.warnings))
+ return fmt_ostatus(queue)
def show_consumers(page, session, queue):
frame = page.show_queue(session, queue).show_view(session)
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-20 20:03:47 UTC (rev 1341)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-20 20:22:42 UTC (rev 1342)
@@ -168,7 +168,7 @@
{status}
-<h1><img src="resource?name=queue-36.png"> {title}</h1>
+<h1><img src="resource?name=queue-36.png"/>{title}</h1>
<table class="props">
<tr><th>Name</th><td>{name}</td></tr>
Added: mgmt/cumin/resources/action-20.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/action-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/action-36.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/action-36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/broker-20.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/broker-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/broker-36.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/broker-36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/client-20.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/client-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/client-36.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/client-36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/cluster-20.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/cluster-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/cluster-36.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/cluster-36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: mgmt/cumin/resources/exchange-20.png
===================================================================
(Binary files differ)
Modified: mgmt/cumin/resources/exchange-36.png
===================================================================
(Binary files differ)
Added: mgmt/cumin/resources/profile-20.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/profile-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/profile-36.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/profile-36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: mgmt/cumin/resources/queue-20.png
===================================================================
(Binary files differ)
Modified: mgmt/cumin/resources/queue-36.png
===================================================================
(Binary files differ)
Added: mgmt/cumin/resources/system-20.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/system-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/cumin/resources/system-36.png
===================================================================
(Binary files differ)
Property changes on: mgmt/cumin/resources/system-36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream