[libvirt-users] [help] how can I use libvirt to get cpu usage ratio ?

Eric Blake eblake at redhat.com
Tue Mar 6 15:55:38 UTC 2012


On 03/06/2012 08:42 AM, hujun_hotmail wrote:
> hi experts:
>   
> 
>    
>     I am a freshman of libvirt, I have got a domU's info like: libvirt.open, lookupByID, info.
> 
>        But now I want to use libvirt to get a xen domU 's cpu usage ratio , how can I fulfill it ?  I cannot find the API.

virNodeGetCPUStats shows the usage of the overall machine (Dom0 + DomU);
and the new virDomainGetCPUStats is the API that was designed to give
per-cpu usage of an individual DomU.  However, no one has yet wired up
the new API to work on xen (for that matter, the patches to wire it up
to qemu-kvm are still waiting for me to review and apply them - I guess
I'd better do that today).  Patches welcome.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120306/75c1ff8e/attachment.sig>


More information about the libvirt-users mailing list