[libvirt-users] How to get guest's cpu and mem usage with Java APIs

Eric Blake eblake at redhat.com
Mon Mar 10 18:16:38 UTC 2014


On 03/10/2014 04:54 AM, Enrico De Maio wrote:
> Hi everybody,
> 
> I'm using libvirt java api bindings for my thesis. I would like to know if
> there is a way to obtain live information about cpu and mem usage of a
> domain.

Are you asking the question from the host's perspective (how much
resources has the host given to the guest) or from the guest's
perspective (how much is the guest actively using, even if the host has
given it more)?  Libvirt already provides several API calls. such as the
ones used by 'virsh cpu-stats' and 'virsh dommemstat'; you may have to
do some code reading to figure out what C calls the virsh code made in
order to find the same API under the Java bindings.

-- 
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/20140310/361cb6bb/attachment.sig>


More information about the libvirt-users mailing list