Hello Ondřej Svoboda,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/24152
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 <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/23598
Tested-by: Ondřej Svoboda <[email protected]>
---
M vdsm/vm.py
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/52/24152/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index bf64195..d88d356 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -609,10 +609,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
--
To view, visit http://gerrit.ovirt.org/24152
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I40daeb12172a7f54f135b3018405ef228983fa93
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Ondřej Svoboda <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches