How i can calculate cpu utilization percentage for host using python libvirt API.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

Hi,

How i can calculate cpu utilization percentage for host using python libvirt API.
Which function can i use for calulating cpu percentage of host and Virtual Machines?

1)Host cpu utilization
 ====================
 I tried getCPUStats() function,it gives the following output.Is there any way to calculate cpu percentage from the following output?
 Is there any other function availabe for calculating cpu utilization percentage?
 
 output:{'kernel': 34870000000L, 'idle': 3522190000000L, 'user': 209930000000L, 'iowait': 132240000000L}


 import libvirt
 conn=libvirt.open('qemu+ssh://root@192.168.1.4/system')
 conn.getCPUStats(-1,0)

 

 

Thanks and Regards,
Deepak S



Message sent via Atmail Open - http://atmail.org/
_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users

[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux