[libvirt-users] Problem in getting memory statistics

Claudio Bley cbley at av-test.de
Mon Mar 17 08:14:16 UTC 2014


At Sat, 15 Mar 2014 23:33:59 +0100,
Pasquale Dir wrote:
> 
> I have another problem.
> As in java bindings there is no way to obtain cpu stats I decided to use a
> python script.
> It gives me, for the guest domain, cpu time, system time and user time.
> Now, what does it mean cpu time? I though that it could be the overall cpu
> time given to this vm...but the sum doesn't add up: user_time+system_time
> != cpu_time.
> As I would need to get a %cpu usage, like virt-manager does (so it IS
> possible, and it IS in python), what operation do I need to do to make this
> happen?

Have a look at the implementation of the _sample_cpu_stats method of
the vmmDomain class here:

https://git.fedorahosted.org/cgit/virt-manager.git/tree/virtManager/domain.py




More information about the libvirt-users mailing list