Skip to content

Commit

Permalink
libvirt
Browse files Browse the repository at this point in the history
  • Loading branch information
ntk148v committed Sep 17, 2024
1 parent 1c3a55d commit 1c929ca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions virtualization/libvirt/cpu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Virtual machine CPU metrics

Libvirt virtual machine (domain) has multiple CPU metrics:

- `VIR_DOMAIN_CPU_STATS_CPUTIME`: cpu usage (sum of both vcpu and hypervisor usage) in nanoseconds, as a ullong.
- `VIR_DOMAIN_CPU_STATS_SYSTEMTIME`: cpu time charged to system instructions in nanoseconds, as a ullong.
- `VIR_DOMAIN_CPU_STATS_USERTIME`: cpu time charged to user instructions in nanoseconds, as a ullong.
- `VIR_DOMAIN_CPU_STATS_VCPUTIME`: vcpu usage in nanoseconds (cpu_time excluding hypervisor time), as a ullong.

If you want to visualize the CPU usage of the machine, you should use `VIR_DOMAIN_CPU_STATS_VCPUTIME` instead of `VIR_DOMAIN_CPU_STATS_CPUTIME` because `VIR_DOMAIN_CPU_STATS_CPUTIME` can be over 100%, it doesn't look right.

0 comments on commit 1c929ca

Please sign in to comment.