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 <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Assaf Muller <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: OndÅ™ej Svoboda <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to