[PATCH 2/5]: virt-manager: draw rx/tx and read/write in one graph each

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Draw separate sparclines for rx/tx (network) and read/write (block).
This patch is unchanged.
 -- Guido

# HG changeset patch
# User "Guido Günther <agx@xxxxxxxxxxx>"
# Date 1224357859 -7200
# Node ID ad0c6107ca6b124a6ccac210c9e4ce4d264cff2d
# Parent  359355108e78b7e440bf31d7bebe398c959ccbe5
use the new multiline feature of the sparcline widget

to draw both rx/tx and read/write into one graph each.

diff -r 359355108e78 -r ad0c6107ca6b src/virtManager/details.py
--- a/src/virtManager/details.py	Sat Oct 18 21:21:33 2008 +0200
+++ b/src/virtManager/details.py	Sat Oct 18 21:24:19 2008 +0200
@@ -191,10 +191,14 @@
 
         self.disk_io_graph = sparkline.Sparkline()
         self.disk_io_graph.set_property("reversed", True)
+        self.disk_io_graph.set_property("filled", False)
+        self.disk_io_graph.set_property("num_sets", 2)
         self.window.get_widget("graph-table").attach(self.disk_io_graph, 1, 2, 2, 3)
  
         self.network_traffic_graph = sparkline.Sparkline()
         self.network_traffic_graph.set_property("reversed", True)
+        self.network_traffic_graph.set_property("filled", False)
+        self.network_traffic_graph.set_property("num_sets", 2)
         self.window.get_widget("graph-table").attach(self.network_traffic_graph, 1, 2, 3, 4)
 
         self.accel_groups = gtk.accel_groups_from_object(topwin)
diff -r 359355108e78 -r ad0c6107ca6b src/virtManager/domain.py
--- a/src/virtManager/domain.py	Sat Oct 18 21:21:33 2008 +0200
+++ b/src/virtManager/domain.py	Sat Oct 18 21:24:19 2008 +0200
@@ -426,23 +426,25 @@
     def network_traffic_vector(self):
         vector = []
         stats = self.record
-        for i in range(self.config.get_stats_history_length()+1):
-            if i < len(stats):
-                vector.append(float(stats[i]["netRxRate"])/
-                              float(self.maxRecord["netRxRate"]))
-            else:
-                vector.append(0.0)
+        ceil = float(max(self.maxRecord["netRxRate"], self.maxRecord["netTxRate"]))
+        for n in [ "netRxRate", "netTxRate" ]:
+            for i in range(self.config.get_stats_history_length()+1):
+                if i < len(stats):
+                    vector.append(float(stats[i][n])/ceil)
+                else:
+                    vector.append(0.0)
         return vector
 
     def disk_io_vector(self):
         vector = []
         stats = self.record
-        for i in range(self.config.get_stats_history_length()+1):
-            if i < len(stats):
-                vector.append(float(stats[i]["diskRdRate"])/
-                              float(self.maxRecord["diskRdRate"]))
-            else:
-                vector.append(0.0)
+        ceil = float(max(self.maxRecord["diskRdRate"], self.maxRecord["diskWrRate"]))
+        for n in [ "diskRdRate", "diskWrRate" ]:
+            for i in range(self.config.get_stats_history_length()+1):
+                if i < len(stats):
+                    vector.append(float(stats[i][n])/ceil)
+                else:
+                    vector.append(0.0)
         return vector
 
     def shutdown(self):
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux