[rhmessaging-commits] rhmessaging commits: r1931 - mgmt/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Thu Apr 17 13:47:55 EDT 2008


Author: justi9
Date: 2008-04-17 13:47:55 -0400 (Thu, 17 Apr 2008)
New Revision: 1931

Modified:
   mgmt/cumin/python/cumin/client.py
   mgmt/cumin/python/cumin/client.strings
Log:
Revamp client stats

Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py	2008-04-17 17:30:14 UTC (rev 1930)
+++ mgmt/cumin/python/cumin/client.py	2008-04-17 17:47:55 UTC (rev 1931)
@@ -211,7 +211,7 @@
         self.__tabs = TabbedModeSet(app, "tabs")
         self.add_child(self.__tabs)
 
-        self.__tabs.add_tab(ClientStatistics(app, "stats"))
+        self.__tabs.add_tab(ClientStats(app, "stats"))
 
         self.__sessions = ClientSessionSet(app, "sessions")
         self.__tabs.add_tab(self.__sessions)
@@ -225,42 +225,28 @@
         data = "model.xml?class=client;id=%i" % queue.id
         return "wooly.setIntervalUpdate('%s', updateClient, 3000)" % data
 
-class ClientStatistics(TabbedModeSet):
+class ClientStats(Widget):
     def __init__(self, app, name):
-        super(ClientStatistics, self).__init__(app, name)
+        super(ClientStats, self).__init__(app, name)
 
-        self.add_tab(self.StatisticsCurrent(app, "current"))
-        self.add_tab(self.StatisticsHistory(app, "history"))
+        self.add_child(StatSet(app, "general", "general"))
 
+        chart = self.SendReceiveRateChart(app, "sendrecv")
+        self.add_child(chart)
+
     def render_title(self, session):
         return "Statistics"
 
-    class StatisticsCurrent(Widget):
+    class SendReceiveRateChart(StatValueChart):
         def __init__(self, app, name):
-            super(ClientStatistics.StatisticsCurrent, self).__init__(app, name)
+            super(ClientStats.SendReceiveRateChart, self).__init__(app, name)
 
-            self.add_child(StatSet(app, "general", "general"))
+            self.stats = ("bytesFromClient", "bytesToClient")
+            self.mode = "rate"
 
-        def render_title(self, session):
-            return "Current"
+        def render_title(self, session, client):
+            return "Bytes Sent and Received"
 
-    class StatisticsHistory(Widget):
-        def __init__(self, app, name):
-            super(ClientStatistics.StatisticsHistory, self).__init__(app, name)
-
-            chart = StatValueChart(app, "sent")
-            chart.stats = ("bytesFromClient",)
-            chart.mode = "rate"
-            self.add_child(chart)
-
-            chart = StatValueChart(app, "received")
-            chart.stats = ("bytesToClient",)
-            chart.mode = "rate"
-            self.add_child(chart)
-
-        def render_title(self, session):
-            return "History"
-
 class ClientSessionSetDetach(CuminBulkActionForm, Frame):
     def process_return(self, session):
         branch = session.branch()

Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings	2008-04-17 17:30:14 UTC (rev 1930)
+++ mgmt/cumin/python/cumin/client.strings	2008-04-17 17:47:55 UTC (rev 1931)
@@ -109,11 +109,7 @@
     cumin.runObjectListeners(client);
 }
 
-[ClientStatistics.html]
-<ul class="radiotabs tabs">{tabs}</ul>
-<div class="radiotabs mode">{mode}</div>
-
-[StatisticsCurrent.html]
+[ClientStats.html]
 <table class="layout">
   <tr>
     <td class="twocol">
@@ -121,17 +117,11 @@
       {general}
     </td>
     <td class="twocol">
+      {sendrecv}
     </td>
   </tr>
 </table>
 
-[StatisticsHistory.html]
-<h2>Bytes Sent</h2>
-<div class="iblock chart">{sent}</div>
-
-<h2>Bytes Received</h2>
-<div class="iblock chart">{received}</div>
-
 [ClientSessionSet.sql]
 select s.id, s.name, c.expire_time as expires, c.attached as status
 from session as s




More information about the rhmessaging-commits mailing list