Change in vdsm[master]: virt: Additional reporting of CPU usage in ns

danken at redhat.com danken at redhat.com
Fri Mar 6 12:47:53 UTC 2015


Dan Kenigsberg has posted comments on this change.

Change subject: virt: Additional reporting of CPU usage in ns
......................................................................


Patch Set 1: Code-Review-1

(2 comments)

https://gerrit.ovirt.org/#/c/38412/1/vdsm/virt/vm.py
File vdsm/virt/vm.py:

Line 484:             stats['cpuUser'] = self._usagePercentage(
Line 485:                 self._diff(eInfo, sInfo, 'cpu_time')
Line 486:                 - self._diff(eInfo, sInfo, 'user_time')
Line 487:                 - self._diff(eInfo, sInfo, 'system_time'),
Line 488:                 sampleInterval)
unlike _usagePercentage(), we have no chance of ZeroDivisionError here. Even TypeError can be ruled out as of line 476. So please place out of try-block.
Line 489:             stats['cpuUsage'] = str(sInfo['cpu_time'] + sInfo['user_time'] +
Line 490:                                     sInfo['system_time'])
Line 491: 
Line 492:         except (TypeError, ZeroDivisionError) as e:


Line 485:                 self._diff(eInfo, sInfo, 'cpu_time')
Line 486:                 - self._diff(eInfo, sInfo, 'user_time')
Line 487:                 - self._diff(eInfo, sInfo, 'system_time'),
Line 488:                 sampleInterval)
Line 489:             stats['cpuUsage'] = str(sInfo['cpu_time'] + sInfo['user_time'] +
I do not think we care about cpu_time. According to our own docs (I did not dive into libvirt's, so please verify) it is the wall time spent by the VM. We do not care about this, if the guest laid dormant.

This feature is about reporting the resources consumed by the VM, which is the sum of user and system time.
Line 490:                                     sInfo['system_time'])
Line 491: 
Line 492:         except (TypeError, ZeroDivisionError) as e:
Line 493:             self._log.exception("CPU stats not available: %s", e)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I31fb4305511f0c2174b217ac24f0d96767c31803
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list