Change in vdsm[master]: vdsm: report remaining values in migration stats

peet at redhat.com peet at redhat.com
Tue May 28 10:42:52 UTC 2013


Peter V. Saveliev has uploaded a new change for review.

Change subject: vdsm: report remaining values in migration stats
......................................................................

vdsm: report remaining values in migration stats

So it would be possible to use such values to draw
eye-candy bars about migration statistics in the frontend.

Signed-off-by: Peter V. Saveliev <peet at redhat.com>
Change-Id: Idc32fa00eaa1b90c3ba9d0afffdeb1cdd8150f9a
---
M vdsm/libvirtvm.py
M vdsm/vm.py
2 files changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/15125/1

diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index 5b16d69..2fcf249 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -377,6 +377,8 @@
         self.daemon = True
         self.data_progress = 0
         self.mem_progress = 0
+        self.remaining = 0
+        self.remaining_lowmark = 0
 
     def run(self):
         def calculateProgress(remaining, total):
@@ -422,6 +424,8 @@
             if jobType == 0:
                 continue
 
+            self.remaining = remaining
+            self.remaining_lowmark = lowmark
             self.data_progress = calculateProgress(dataRemaining, dataTotal)
             self.mem_progress = calculateProgress(memRemaining, memTotal)
 
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 2b76662..53def15 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -124,9 +124,12 @@
         """
         if self._monitorThread is not None:
             # fetch migration status from the monitor thread
+            # shortcut to make flake8 happy
+            t = self._monitorThread
             self.status['progress'] = int(
-                float(self._monitorThread.data_progress +
-                      self._monitorThread.mem_progress) / 2)
+                float(t.data_progress + t.mem_progress) / 2)
+            self.status['remaining'] = t.remaining
+            self.status['remaining_lowmark'] = t.remaining_lowmark
         return self.status
 
     def _setupVdsConnection(self):


--
To view, visit http://gerrit.ovirt.org/15125
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc32fa00eaa1b90c3ba9d0afffdeb1cdd8150f9a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Peter V. Saveliev <peet at redhat.com>


More information about the vdsm-patches mailing list