Hello Yaniv Bronhaim, Ondřej Svoboda, Antoni Segura Puimedon,
I'd like you to do a code review. Please visit
to review the following change.
Change subject: vm iface statistics: never report negative rates ......................................................................
vm iface statistics: never report negative rates
When Linux tx/rx couters overflow their 32 bit limit, they wrap back to zero. This causes our reported rxRate/txRate to become negative for one nample. 51073875161d9b932b7
Bug-Url: https://bugzilla.redhat.com/1062166 Change-Id: I40daeb12172a7f54f135b3018405ef228983fa93 Signed-off-by: Dan Kenigsberg danken@redhat.com Reviewed-on: http://gerrit.ovirt.org/23598 Tested-by: Ondřej Svoboda osvoboda@redhat.com Reviewed-on: http://gerrit.ovirt.org/24152 Reviewed-by: Antoni Segura Puimedon asegurap@redhat.com Reviewed-by: Yaniv Bronhaim ybronhei@redhat.com --- M vdsm/vm.py 1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/24322/1
diff --git a/vdsm/vm.py b/vdsm/vm.py index bb35f0e..3534699 100644 --- a/vdsm/vm.py +++ b/vdsm/vm.py @@ -616,10 +616,12 @@ ifStats['txDropped'] = str(eInfo[nic.name][7])
ifRxBytes = (100.0 * - (eInfo[nic.name][0] - sInfo[nic.name][0]) / + (eInfo[nic.name][0] - sInfo[nic.name][0]) % + 2 ** 32 / sampleInterval / ifSpeed / self.MBPS_TO_BPS) ifTxBytes = (100.0 * - (eInfo[nic.name][4] - sInfo[nic.name][4]) / + (eInfo[nic.name][4] - sInfo[nic.name][4]) % + 2 ** 32 / sampleInterval / ifSpeed / self.MBPS_TO_BPS)
ifStats['rxRate'] = '%.1f' % ifRxBytes