Change in vdsm[master]: sampling: rename variables to make code nicer

fromani at redhat.com fromani at redhat.com
Thu Oct 23 08:26:47 UTC 2014


Francesco Romani has uploaded a new change for review.

Change subject: sampling: rename variables to make code nicer
......................................................................

sampling: rename variables to make code nicer

Rename internal variables of SampleWindow
methods to make the code nicer and easier
to read.

No changes in behaviour.

Change-Id: I14caeb163552a659d1e7fcc103ac7fc9f1697bad
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/sampling.py
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/34390/1

diff --git a/vdsm/virt/sampling.py b/vdsm/virt/sampling.py
index ea2f99f..bee85bd 100644
--- a/vdsm/virt/sampling.py
+++ b/vdsm/virt/sampling.py
@@ -329,10 +329,11 @@
         if len(self._samples) < 2:
             return None, None, None
 
-        bgn_time, bgn_sample = self._samples[0]
-        end_time, end_sample = self._samples[-1]
+        first_timestamp, first_value = self._samples[0]
+        last_timestamp, last_value = self._samples[-1]
 
-        return bgn_sample, end_sample, (end_time - bgn_time)
+        elapsed_time = last_timestamp - first_timestamp
+        return first_value, last_value, elapsed_time
 
     def last(self):
         """
@@ -340,8 +341,8 @@
         """
         if not self._samples:
             return None
-        last_time, last_sample = self._samples[-1]
-        return last_sample
+        _, last_value = self._samples[-1]
+        return last_value
 
 
 class AdvancedStatsFunction(object):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I14caeb163552a659d1e7fcc103ac7fc9f1697bad
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list