Mark Wu has posted comments on this change.

Change subject: report cpuUser and cpuSys separately
......................................................................


Patch Set 1: (1 inline comment)

....................................................
File vdsm/libvirtvm.py
Line 173: 
Line 174:         try:
Line 175:             stats['cpuUser'] = 100 * (eInfo['user_time'] - 
sInfo['user_time']) / sampleInterval / nanos
Line 176:             stats['cpuSys'] = 100 * (eInfo['system_time'] - 
sInfo['system_time']) / sampleInterval / nanos
Line 177:             cpuTime = 100 * (eInfo['cpu_time'] - sInfo['cpu_time']) / 
sampleInterval / (nanos * ticks)
Libvirt use cpuacct to collect cpu stats:
/sys/fs/cgroup/cpuacct.usage gives the CPU time (in nanoseconds) (reported as 
cpuTime in libvirt API)

user: Time spent by tasks of the cgroup in user mode.
system: Time spent by tasks of the cgroup in kernel mode.
user and system are in USER_HZ unit.

You could take a look:
http://www.kernel.org/doc/Documentation/cgroups/cpuacct.txt

Libvirt convert user and system into nanoseconds:
You could see it in function virCgroupGetCpuacctStat

But libvirt doesn't change the value of usage, so I think it's in nanoseconds.
Line 178:         except (TypeError, ZeroDivisionError) as e:
Line 179:             self._log.debug("CPU stats not available: %s", e)
Line 180:             stats['cpuUser'] = 0.0
Line 181:             stats['cpuSys'] = 0.0


--
To view, visit http://gerrit.ovirt.org/7718
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I663ad25ff3ff5ce426b5159b6c9a65b7f5167605
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Gal Hammer <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to