Change in vdsm[master]: virt: sampling: add StatsCache

fromani at redhat.com fromani at redhat.com
Tue Mar 31 11:18:12 UTC 2015


Francesco Romani has posted comments on this change.

Change subject: virt: sampling: add StatsCache
......................................................................


Patch Set 2:

(3 comments)

https://gerrit.ovirt.org/#/c/39331/2/vdsm/virt/sampling.py
File vdsm/virt/sampling.py:

Line 404: class StatsCache(object):
Line 405:     def __init__(self, log=None):
Line 406:         self._log = (log if log is not None else
Line 407:                      logging.getLogger("sampling.StatsCache"))
Line 408:         self._samples = SampleWindow(2)
move here the change from patch 38066
Line 409:         self._last_sample_time = 0
Line 410: 
Line 411:     def get(self, vmid):
Line 412:         first_batch, last_batch, interval = self._samples.stats()


Line 410: 
Line 411:     def get(self, vmid):
Line 412:         first_batch, last_batch, interval = self._samples.stats()
Line 413:         if first_batch is None:
Line 414:             return (None, None, interval)
always return None
Line 415: 
Line 416:         first_sample = first_batch.get(vmid)
Line 417:         last_sample = last_batch.get(vmid)
Line 418:         return (first_sample, last_sample, interval)


Line 430:         else:
Line 431:             sample = batch.get(vmid)
Line 432: 
Line 433:         if sample is None:
Line 434:             return None, 0
same here always return None
Line 435:         else:
Line 436:             return sample, timestamp
Line 437: 
Line 438: 


-- 
To view, visit https://gerrit.ovirt.org/39331
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I11d5069f49d54bb5f43a7c4914c7e4b9f8093db9
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list