[libvirt-users] How i can calculate cpu utilization percentage for domain running under a host using libvirt API.

Eric Blake eblake at redhat.com
Fri May 23 13:20:21 UTC 2014


[long subject line!]

On 05/23/2014 01:19 AM, deepak at fluentsoft.com wrote:
> How i can calculate cpu utilization percentage for domain running under a
> host using libvirt API.
> Which function can i use for calulating cpu percentage?

You have to calculate the percentage utilization yourself by making
repeated queries to the cpu status calls, and tracking how the
cumulative usage grows over time.  You may want to look at the source
code of virt-top for ideas on how to do it.

-- 
Eric Blake   eblake 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: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20140523/90536b82/attachment.sig>


More information about the libvirt-users mailing list