Dan Kenigsberg has submitted this change and it was merged.

Change subject: vmstats: Fix cpu usage key names
......................................................................


vmstats: Fix cpu usage key names

Since commit 9ba66c903083e (virt: Additional reporting of CPU usage in
ns) we are accessing the wrong keys, filling the logs with:

    Traceback (most recent call last):
      File "/usr/share/vdsm/virt/vm.py", line 1338, in _getRunningVmStats
        vm_sample.interval)
      File "/usr/share/vdsm/virt/vmstats.py", line 37, in produce
        cpu(stats, first_sample, last_sample, interval)
      File "/usr/share/vdsm/virt/vmstats.py", line 78, in cpu
        stats['cpuUsage'] = str(last_sample['system_time']
    KeyError: 'system_time'

Now we check the correct keys, and do this inside the try block handling
missing keys, so errors are reported in a consistent way.

Change-Id: Id26c427d67de47cbcc39ddd43ab4cfe8467432c4
Signed-off-by: Nir Soffer <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/40845
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <[email protected]>
Reviewed-by: Piotr Kliczewski <[email protected]>
Reviewed-by: Dan Kenigsberg <[email protected]>
Tested-by: Piotr Kliczewski <[email protected]>
---
M vdsm/virt/vmstats.py
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Piotr Kliczewski: Verified; Looks good to me, but someone else must approve
  Jenkins CI: Passed CI tests
  Dan Kenigsberg: Looks good to me, approved
  Francesco Romani: Looks good to me, but someone else must approve



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id26c427d67de47cbcc39ddd43ab4cfe8467432c4
Gerrit-PatchSet: 3
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: Piotr Kliczewski <[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