Dan Kenigsberg has submitted this change and it was merged.

Change subject: vmstats: network: avoid ZeroDivisionError
......................................................................


vmstats: network: avoid ZeroDivisionError

For still under investigation case, after migration
sometimes vmstats code is fed with zero-intervalled samples.
While we investigate the root cause, handle gracefully ZeroDivisionError
adding guards in the public functions that have an 'interval' argument.

The only left one was 'networks', so this patch fixes that.

It is not good enough to generalize the check in vmstats.produce()
because the relevant functions (cpu, disks, networks) are part of
the public API of the module, so they should handle bad input properly.

To improve testability, we fix the return value of the aforementioned
functions. The return value is meant to be used only in testing.

X-Backport-To: 3.6
Change-Id: I1ff99e3706212179ef9dc56e92e7d5decdd6bd7a
Signed-off-by: Francesco Romani <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/44764
Reviewed-by: Dan Kenigsberg <[email protected]>
Continuous-Integration: Dan Kenigsberg <[email protected]>
---
M tests/vmStatsTests.py
M vdsm/virt/vmstats.py
2 files changed, 45 insertions(+), 4 deletions(-)

Approvals:
  Dan Kenigsberg: Looks good to me, approved; Passed CI tests
  Francesco Romani: Verified



-- 
To view, visit https://gerrit.ovirt.org/44764
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1ff99e3706212179ef9dc56e92e7d5decdd6bd7a
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Martin Polednik <[email protected]>
Gerrit-Reviewer: Vinzenz Feenstra <[email protected]>
Gerrit-Reviewer: [email protected]
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to