From Yaniv Bronhaim ybronhei@redhat.com:
Yaniv Bronhaim has uploaded a new change for review.
Change subject: checking balloonInfo existance in vmstat metrics ......................................................................
checking balloonInfo existance in vmstat metrics
Change-Id: I8677bcf180d17ea2cfde3ee152b4e9bc056263c4 Signed-off-by: Yaniv Bronhaim ybronhei@redhat.com --- M lib/vdsm/virt/vmstats.py 1 file changed, 9 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/07/68407/1
diff --git a/lib/vdsm/virt/vmstats.py b/lib/vdsm/virt/vmstats.py index 8f64059..0bbad41 100644 --- a/lib/vdsm/virt/vmstats.py +++ b/lib/vdsm/virt/vmstats.py @@ -200,14 +200,15 @@ data[prefix + '.cpu.sys'] = stat['cpuSys'] data[prefix + '.cpu.usage'] = stat['cpuUsage']
- data[prefix + '.balloon.max'] = \ - stat['balloonInfo']['balloon_max'] - data[prefix + '.balloon.min'] = \ - stat['balloonInfo']['balloon_min'] - data[prefix + '.balloon.target'] = \ - stat['balloonInfo']['balloon_target'] - data[prefix + '.balloon.cur'] = \ - stat['balloonInfo']['balloon_cur'] + if 'balloonInfo' in stat: + data[prefix + '.balloon.max'] = \ + stat['balloonInfo']['balloon_max'] + data[prefix + '.balloon.min'] = \ + stat['balloonInfo']['balloon_min'] + data[prefix + '.balloon.target'] = \ + stat['balloonInfo']['balloon_target'] + data[prefix + '.balloon.cur'] = \ + stat['balloonInfo']['balloon_cur']
if 'disks' in stat: for disk in stat['disks']:
From Yaniv Bronhaim ybronhei@redhat.com:
Yaniv Bronhaim has posted comments on this change.
Change subject: Checking if stat[balloonInfo] is not empty in vmstat metrics ......................................................................
Patch Set 2: Verified+1
From Yaniv Bronhaim ybronhei@redhat.com:
Yaniv Bronhaim has posted comments on this change.
Change subject: Checking if stat[balloonInfo] is not empty in vmstat metrics ......................................................................
Patch Set 2:
please take..
From Yaniv Bronhaim ybronhei@redhat.com:
Yaniv Bronhaim has posted comments on this change.
Change subject: Checking if stat[balloonInfo] is not empty in vmstat metrics ......................................................................
Patch Set 2:
(1 comment)
https://gerrit.ovirt.org/#/c/68407/2/lib/vdsm/virt/vmstats.py File lib/vdsm/virt/vmstats.py:
PS2, Line 203: if stat['balloonInfo']:
I would write:
its not the same. balloonInfo key always exists. this checks if under the key its empty dict or not. if '..' in stats checks if key exists in dict
From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Checking if stat[balloonInfo] is not empty in vmstat metrics ......................................................................
Checking if stat[balloonInfo] is not empty in vmstat metrics
Fixing KeyError when memory balloon device is not enable. Apparently the key always exists, but when disabled its value is empty dict.
Change-Id: I8677bcf180d17ea2cfde3ee152b4e9bc056263c4 Signed-off-by: Yaniv Bronhaim ybronhei@redhat.com --- M lib/vdsm/virt/vmstats.py 1 file changed, 9 insertions(+), 8 deletions(-)
Approvals: Yaniv Bronhaim: Verified Jenkins CI: Passed CI tests Irit Goihman: Looks good to me, but someone else must approve Francesco Romani: Looks good to me, approved
vdsm-patches@lists.fedorahosted.org