Change in vdsm[master]: sampling: hoststats: switch to SampleWindow

danken at redhat.com danken at redhat.com
Mon May 25 13:32:40 UTC 2015


Dan Kenigsberg has posted comments on this change.

Change subject: sampling: hoststats: switch to SampleWindow
......................................................................


Patch Set 8:

(3 comments)

https://gerrit.ovirt.org/#/c/40428/8/vdsm/virt/sampling.py
File vdsm/virt/sampling.py:

Line 613:             'elapsedTime': int(time.time() - self.startTime)
Line 614:         }
Line 615: 
Line 616:         hs0, hs1, _ = self._samples.stats()
Line 617:         # we need a different interval, see below
it is not clear (to me) to what does this comment relate to. Is it related to the fact we ignore the interval here; it is calculated 2 lines below?
Line 618:         if hs0 is None or hs1 is None:
Line 619:             return stats
Line 620: 
Line 621:         stats.update(self._getInterfacesStats())


Line 614:         }
Line 615: 
Line 616:         hs0, hs1, _ = self._samples.stats()
Line 617:         # we need a different interval, see below
Line 618:         if hs0 is None or hs1 is None:
checking for hs1 is enough, right? if it is there, hs0 must exist.
Line 619:             return stats
Line 620: 
Line 621:         stats.update(self._getInterfacesStats())
Line 622: 


Line 681: 
Line 682:     def _getInterfacesStats(self):
Line 683:         stats = {}
Line 684:         hs0, hs1, _ = self._samples.stats()
Line 685:         if hs0 is None:
wouldn't this explode on the very start of vdsm, when only one sample has been taken, and hs1 is None?
Line 686:             return stats
Line 687:         interval = hs1.timestamp - hs0.timestamp
Line 688: 
Line 689:         rx = tx = rxDropped = txDropped = 0


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I5ec5712ee1fb69ed3d8dbc28ca4e6511998270c9
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list