The accurate CPU usage of a domain?

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

 



Hi,all

I want to get a relatively accurate cpu usage of a domain. I have a few questions about  virDomainGetInfo:
  
  1. struct virDomainInfo{  
  2. unsigned char state : //the running state, one of virDomainState    
  3. unsigned long maxMem :// the maximum memory in KBytes allowed   
  4. unsigned long memory :// the memory in KBytes used by the domain   
  5. unsigned short nrVirtCpu :// the number of virtual CPUs for&! nbsp;the domain   
  6. unsigned long long cpuTime : //the CPU time used in nanoseconds   
  7. }  

If a domain is assigned to 4 vcpus and my machine has 6 physical cores, then the cpuTime in virDomainInfo should be the sum of cpu time of the 4 vcpus. When I want to calculate the cpu usage, which of the following is more accurate?
      1/4 * cpu time /  total time  or  4/6 * cpu time / total time  or just cpu time / total time 


regards
zhangzhang


_______________________________________________
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