Change in vdsm[master]: vm iface stats: fix arithmetic
danken at redhat.com
danken at redhat.com
Thu Mar 20 20:51:26 UTC 2014
Dan Kenigsberg has uploaded a new change for review.
Change subject: vm iface stats: fix arithmetic
......................................................................
vm iface stats: fix arithmetic
My commit 672ff43 has a serious arithmetic flaw: the modulu must be
taken on the sample difference!
Bug-Url: https://bugzilla.redhat.com/1062166
Change-Id: Ie356d5f96c73b65925b38f6149d5eb36f43023ad
Signed-off-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/vm.py
1 file changed, 4 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/60/25960/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index c53f1d4..b81653d 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -606,12 +606,12 @@
ifStats['txDropped'] = str(eInfo[nic.name][7])
ifRxBytes = (100.0 *
- (eInfo[nic.name][0] - sInfo[nic.name][0]) %
- 2 ** 32 /
+ ((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]) %
- 2 ** 32 /
+ ((eInfo[nic.name][4] - sInfo[nic.name][4]) %
+ 2 ** 32) /
sampleInterval / ifSpeed / self.MBPS_TO_BPS)
ifStats['rxRate'] = '%.1f' % ifRxBytes
--
To view, visit http://gerrit.ovirt.org/25960
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie356d5f96c73b65925b38f6149d5eb36f43023ad
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>
More information about the vdsm-patches
mailing list