Change in vdsm[ovirt-3.4]: vm iface statistics: never report negative rates

nsoffer at redhat.com nsoffer at redhat.com
Thu Feb 6 21:48:30 UTC 2014


Nir Soffer has posted comments on this change.

Change subject: vm iface statistics: never report negative rates
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

Change may be correct, but introduce duplicated undocumented magic number. Not clear where this number comes from, if we can get it from the system, and if this number can change in future version, breaking the proposed change.

http://gerrit.ovirt.org/#/c/24152/1/vdsm/vm.py
File vdsm/vm.py:

Line 609:                 ifStats['txDropped'] = str(eInfo[nic.name][7])
Line 610: 
Line 611:                 ifRxBytes = (100.0 *
Line 612:                              (eInfo[nic.name][0] - sInfo[nic.name][0]) %
Line 613:                              2 ** 32 /
Use constant and explain why the maximum value is 2**32. Can we get this value from the system instead of using a hardcoded value?
Line 614:                              sampleInterval / ifSpeed / self.MBPS_TO_BPS)
Line 615:                 ifTxBytes = (100.0 *
Line 616:                              (eInfo[nic.name][4] - sInfo[nic.name][4]) %
Line 617:                              2 ** 32 /


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I40daeb12172a7f54f135b3018405ef228983fa93
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list