Author: justi9
Date: 2007-11-02 16:41:27 -0400 (Fri, 02 Nov 2007)
New Revision: 1223
Modified:
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/client.strings
mgmt/cumin/python/cumin/model.py
Log:
Adds a stats tab to client. Improves the stats metadata for client.
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-11-02 20:18:16 UTC (rev 1222)
+++ mgmt/cumin/python/cumin/client.py 2007-11-02 20:41:27 UTC (rev 1223)
@@ -1,6 +1,7 @@
from wooly import *
from wooly.widgets import *
+from measurement import *
from widgets import *
from parameters import *
from util import *
@@ -62,7 +63,8 @@
self.tabs = TabSet(app, "tabs")
self.add_child(self.tabs)
- self.tabs.add_tab(SessionSet(app, "bindings"))
+ self.tabs.add_tab(ClientStatistics(app, "stats"))
+ self.tabs.add_tab(ClientSessionSet(app, "bindings"))
def render_title(self, session, client):
return "Client '%s'" % client.address
@@ -73,8 +75,31 @@
def render_auth_id(self, session, client):
return "e50e7dcaa8d6a039a"
-class SessionSet(ItemSet):
+class ClientStatistics(TabSet):
+ def __init__(self, app, name):
+ super(ClientStatistics, self).__init__(app, name)
+
+ self.add_tab(self.StatisticsCurrent(app, "current"))
+ self.add_tab(self.StatisticsHistory(app, "history"))
+
def render_title(self, session, client):
+ return "Statistics"
+
+ class StatisticsCurrent(Widget):
+ def __init__(self, app, name):
+ super(ClientStatistics.StatisticsCurrent, self).__init__(app, name)
+
+ self.add_child(MeasurementSet(app, "general_stats",
"general"))
+
+ def render_title(self, session, client):
+ return "Current"
+
+ class StatisticsHistory(Widget):
+ def render_title(self, session, client):
+ return "History"
+
+class ClientSessionSet(ItemSet):
+ def render_title(self, session, client):
return "Sessions (%i)" % len(client.session_items())
def get_items(self, session, client):
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-11-02 20:18:16 UTC (rev 1222)
+++ mgmt/cumin/python/cumin/client.strings 2007-11-02 20:41:27 UTC (rev 1223)
@@ -51,10 +51,26 @@
{tabs}
-[SessionSet.html]
+[ClientStatistics.html]
+<ul class="radiotabs tabs">{tabs}</ul>
+<div class="radiotabs mode">{mode}</div>
+
+[StatisticsCurrent.html]
+<table class="layout">
+ <tr>
+ <td class="twocol">
+ <h2>General</h2>
+ {general_stats}
+ </td>
+ <td class="twocol">
+ </td>
+ </tr>
+</table>
+
+[ClientSessionSet.html]
<div class="sactions">
<h2>Act on Selected Sessions:</h2>
- <button>Solicit Acknowledgment</button>
+ <button>Solicit Ack</button>
<button>Reset Lifespan</button>
<button>Detach</button>
<button>Close</button>
@@ -72,7 +88,7 @@
{items}
</table>
-[SessionSet.item_html]
+[ClientSessionSet.item_html]
<tr>
<td><input type="checkbox"/></td>
<td>{item_name}</td>
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2007-11-02 20:18:16 UTC (rev 1222)
+++ mgmt/cumin/python/cumin/model.py 2007-11-02 20:41:27 UTC (rev 1223)
@@ -703,12 +703,12 @@
self.name = None
measure = Measurement("msgsProduced", "int")
- measure.title = "Messages produced"
+ measure.title = "Msgs. Produced"
measure.categories = ("message", "general")
self.measurements.append(measure)
measure = Measurement("bytesProduced", "int")
- measure.title = "Bytes produced"
+ measure.title = "Bytes Produced"
measure.categories = ("byte", "general")
self.measurements.append(measure)
@@ -719,7 +719,7 @@
self.binding_key = None
measure = Measurement("msgMatched", "int")
- measure.title = "Messages matched"
+ measure.title = "Msgs. Matched"
measure.categories = ("message", "general")
self.measurements.append(measure)
@@ -740,23 +740,23 @@
self.warnings = list()
measure = Measurement("msgsProduced", "int")
- measure.title = "Messages produced"
+ measure.title = "Msgs. Produced"
measure.categories = ("message", "general")
self.measurements.append(measure)
measure = Measurement("msgsConsumed", "int")
- measure.title = "Messages consumed"
+ measure.title = "Msgs. Consumed"
measure.categories = ("message", "general")
self.measurements.append(measure)
measure = Measurement("bytesProduced", "int")
- measure.title = "Bytes produced"
+ measure.title = "Bytes Produced"
measure.categories = ("byte", "general")
self.measurements.append(measure)
measure = Measurement("bytesConsumed", "int")
- measure.title = "Bytes consumed"
- measure.categories = ("message", "general")
+ measure.title = "Bytes Consumed"
+ measure.categories = ("byte", "general")
self.measurements.append(measure)
class Session(MeasuredModelObject):