Francesco Romani has posted comments on this change.
Change subject: vmstats: Handle missing system_time and user_time
......................................................................
Patch Set 1: Code-Review-1
this change fixes the issue, but it is not the fix I'd like to have.
The main issue was in the rebase.
The old code on which the change 0ba66c903083e was using the GetCpuStats API,
which returned a dict with these keys.
The new code uses the bulk stats API, which provides the same information with
different keys.
The correct fix is just to change the names of the keys we use
@@ -75,8 +75,8 @@ def cpu(stats, first_sample, last_sample, interval):
if first_sample is None or last_sample is None:
return
- stats['cpuUsage'] = str(last_sample['system_time']
- + last_sample['user_time'])
+ stats['cpuUsage'] = str(last_sample['cpu.system']
+ + last_sample['cpu.user'])
On top of that, we should move this code in the try/except right below, to make
sure that if the keys are missing from bulk stats (because error inside
libvirt) the logs aren't spammed.
The bottom line is I was not careful enough in the review :\
--
To view, visit https://gerrit.ovirt.org/40845
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Id26c427d67de47cbcc39ddd43ab4cfe8467432c4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Vinzenz Feenstra <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: No
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches