[PATCH 7/9]: virt-manager: draw rx/tx and read/write in one graph

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

 



Draw separate sparclines for rx/tx (network) and read/write (block).
Depends on the sparkline muti patch.
 -- Guido
Draw separate sparclines for rx/tx and read/write

diff -r e77bf4f75349 src/virtManager/details.py
--- a/src/virtManager/details.py	Sat Oct 04 15:08:48 2008 +0200
+++ b/src/virtManager/details.py	Sat Oct 04 16:06:05 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 e77bf4f75349 src/virtManager/domain.py
--- a/src/virtManager/domain.py	Sat Oct 04 15:08:48 2008 +0200
+++ b/src/virtManager/domain.py	Sat Oct 04 16:06:05 2008 +0200
@@ -425,23 +425,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