r5403 - trunk/cumin/python/cumin/grid

croberts at fedoraproject.org croberts at fedoraproject.org
Wed Jun 6 16:04:28 UTC 2012


Author: croberts
Date: 2012-06-06 16:04:27 +0000 (Wed, 06 Jun 2012)
New Revision: 5403

Modified:
   trunk/cumin/python/cumin/grid/dashboard.py
Log:
Adding historical charts for pool memory and cpus based on the data from plumage.

Modified: trunk/cumin/python/cumin/grid/dashboard.py
===================================================================
--- trunk/cumin/python/cumin/grid/dashboard.py	2012-06-05 17:36:50 UTC (rev 5402)
+++ trunk/cumin/python/cumin/grid/dashboard.py	2012-06-06 16:04:27 UTC (rev 5403)
@@ -45,15 +45,38 @@
     def __init__(self, app, name):
         super(DashboardHistory, self).__init__(app, name)
         
+        charts = WidgetSet(app, "charts")
+        self.add_child(charts)
+        
         chart = self.PoolEfficiencyChart(app, "eff", app.model.com_redhat_grid_plumage.OSUtil)
         chart.stats = ["efficiency"]
         chart.max_samples = 250
         chart.duration.param.default = "3600"
-        self.add_child(chart)   
+        charts.add_child(chart)   
+
+        chart = self.PoolMemoryChart(app, "fmem", app.model.com_redhat_grid_plumage.OSUtil)
+        chart.stats = ["usedmem", "freemem"]
+        chart.max_samples = 250
+        chart.duration.param.default = "3600"
+        charts.add_child(chart)
         
+        chart = self.PoolCpuChart(app, "fcpu", app.model.com_redhat_grid_plumage.OSUtil)
+        chart.stats = [ "usedcpu", "freecpu"]
+        chart.max_samples = 250
+        chart.duration.param.default = "3600"
+        charts.add_child(chart)
+        
     def render_title(self, session):
         return "History"
     
+    class PoolMemoryChart(ReportingChart):
+        def render_title(self, session):
+            return "Pool memory"
+        
+    class PoolCpuChart(ReportingChart):
+        def render_title(self, session):
+            return "Pool cpus"        
+    
     class PoolEfficiencyChart(ReportingChart):
         def render_title(self, session):
             return "Pool efficiency"    
@@ -663,6 +686,10 @@
         options.group_column = ",".join((self.sum_column, self.act_state_column.identifier))
 
         records = self.get_data(values, options)
+        for i in range(1,5):
+            record = records[0]
+            record = ('Linux%d' % i, 50L, 'IdleUnclaimed')
+            records.append(record)
 
         # accumulate records by os/used|unused manually
         recs_by_os = dict()



More information about the cumin-developers mailing list