Francesco Romani has uploaded a new change for review.
Change subject: sampling: rename variables for clarity ......................................................................
sampling: rename variables for clarity
Rename: hs0 -> first_sample hs1 -> last_sample
for clarity, and to conform to naming used elsewhere in the module/package. No changes in logic.
Change-Id: I24d07414c96dcd047966bb28cd2f756640692f1c Signed-off-by: Francesco Romani fromani@redhat.com --- M vdsm/virt/sampling.py 1 file changed, 17 insertions(+), 13 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/41219/1
diff --git a/vdsm/virt/sampling.py b/vdsm/virt/sampling.py index 9ad6143..1ee485e 100644 --- a/vdsm/virt/sampling.py +++ b/vdsm/virt/sampling.py @@ -613,37 +613,41 @@ 'elapsedTime': int(time.time() - self.startTime) }
- hs0, hs1, _ = self._samples.stats() + first_sample, last_sample, _ = self._samples.stats() # we need a different interval, see below - if hs0 is None or hs1 is None: + if first_sample is None or last_sample is None: return stats
stats.update(self._getInterfacesStats())
- interval = hs1.timestamp - hs0.timestamp + interval = last_sample.timestamp - first_sample.timestamp
- jiffies = (hs1.pidcpu.user - hs0.pidcpu.user) % (2 ** 32) + jiffies = ( + last_sample.pidcpu.user - first_sample.pidcpu.user) % (2 ** 32) stats['cpuUserVdsmd'] = jiffies / interval - jiffies = (hs1.pidcpu.sys - hs0.pidcpu.sys) % (2 ** 32) + jiffies = ( + last_sample.pidcpu.sys - first_sample.pidcpu.sys) % (2 ** 32) stats['cpuSysVdsmd'] = jiffies / interval
- jiffies = (hs1.totcpu.user - hs0.totcpu.user) % (2 ** 32) + jiffies = ( + last_sample.totcpu.user - first_sample.totcpu.user) % (2 ** 32) stats['cpuUser'] = jiffies / interval / self._ncpus - jiffies = (hs1.totcpu.sys - hs0.totcpu.sys) % (2 ** 32) + jiffies = ( + last_sample.totcpu.sys - first_sample.totcpu.sys) % (2 ** 32) stats['cpuSys'] = jiffies / interval / self._ncpus stats['cpuIdle'] = max(0.0, 100.0 - stats['cpuUser'] - stats['cpuSys']) - stats['memUsed'] = hs1.memUsed - stats['anonHugePages'] = hs1.anonHugePages - stats['cpuLoad'] = hs1.cpuLoad + stats['memUsed'] = last_sample.memUsed + stats['anonHugePages'] = last_sample.anonHugePages + stats['cpuLoad'] = last_sample.cpuLoad
- stats['diskStats'] = hs1.diskStats - stats['thpState'] = hs1.thpState + stats['diskStats'] = last_sample.diskStats + stats['thpState'] = last_sample.thpState
if self._boot_time(): stats['bootTime'] = self._boot_time()
- stats['numaNodeMemFree'] = hs1.numaNodeMem.nodesMemSample + stats['numaNodeMemFree'] = last_sample.numaNodeMem.nodesMemSample stats['cpuStatistics'] = self._getCpuCoresStats()
stats['v2vJobs'] = v2v.get_jobs_status()
automation@ovirt.org has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Dan Kenigsberg has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 3: Code-Review+2
I loved hs0 and hs1, but never mind me.
automation@ovirt.org has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 4:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 5:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 6:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Francesco Romani has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 6: Verified+1
verified running vdsClient -s 0 getVdsStats a few times. Code's not exploding, get() is triggered, so seems fine.
automation@ovirt.org has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 7:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 8:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 9:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Dan Kenigsberg has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 9: Code-Review+1
I find hs0 hs1 so very clear... maybe it is just my physics education.
automation@ovirt.org has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 10:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Francesco Romani has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 10: Verified+1
verified running patched VDSM on Engine (no VMs, just polling) -> no errors reported or spotted in the logs. Additional verification running manually vdsClient getVdsStats
Dan Kenigsberg has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 10: Code-Review+2
let it be... we've done that for vm stats, let's follow with host stats.
Dan Kenigsberg has submitted this change and it was merged.
Change subject: sampling: rename variables for clarity ......................................................................
sampling: rename variables for clarity
Rename: hs0 -> first_sample hs1 -> last_sample
for clarity, and to conform to naming used elsewhere in the module/package. No changes in logic.
Change-Id: I24d07414c96dcd047966bb28cd2f756640692f1c Signed-off-by: Francesco Romani fromani@redhat.com Reviewed-on: https://gerrit.ovirt.org/41219 Continuous-Integration: Jenkins CI Reviewed-by: Dan Kenigsberg danken@redhat.com --- M vdsm/virt/sampling.py 1 file changed, 21 insertions(+), 13 deletions(-)
Approvals: Jenkins CI: Passed CI tests Dan Kenigsberg: Looks good to me, approved Francesco Romani: Verified
automation@ovirt.org has posted comments on this change.
Change subject: sampling: rename variables for clarity ......................................................................
Patch Set 11:
* Update tracker::IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org