Change in vdsm[ovirt-3.6]: vmstats: handle known-missing stats

mpolednik at redhat.com mpolednik at redhat.com
Wed Mar 2 10:34:02 UTC 2016


Martin Polednik has posted comments on this change.

Change subject: vmstats: handle known-missing stats
......................................................................


Patch Set 2: Code-Review-1

(1 comment)

Maybe overlooked something, but question inside. Otherwise, it is fine by me IF we really can make sure that this will not just hide KeyError behind a different exception.

https://gerrit.ovirt.org/#/c/53992/2/vdsm/virt/vmstats.py
File vdsm/virt/vmstats.py:

Line 187:         ifStats['rxDropped'] = str(end_sample['net.%d.rx.drop' % end_index])
Line 188:         ifStats['txErrors'] = str(end_sample['net.%d.tx.errs' % end_index])
Line 189:         ifStats['txDropped'] = str(end_sample['net.%d.tx.drop' % end_index])
Line 190: 
Line 191:     with _skip_if_missing_stats(vm_obj):
Although they KeyError will get swallowed, the code further will raise other exceptions e.g. (rxDelta % 2 ** 32) would raise NameError. Can't we return earlier?
Line 192:         rxDelta = (
Line 193:             end_sample['net.%d.rx.bytes' % end_index] -
Line 194:             start_sample['net.%d.rx.bytes' % start_index]
Line 195:         )


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I04ecbf98d36d576ede3c3cde36586245ea5e4218
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list