Skip to content
Snippets Groups Projects
Commit 7fa0cad8 authored by Antoine Millet's avatar Antoine Millet
Browse files

Fixed cpuuse tag on VM

CPU usage was calculated without taking SMP VM into account.
parent 2a5af11d
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,7 @@ def cpuuse(dom):
dom.cpu_stats = (dom.hypervisor.handler.main.evloop.now(), cpu_time)
# calculate CPU percentage, code is from virt-manager in domain.py:1210
return '%.2f' % max(0., min(100., ((cpu_time - old_cpu_stats[1]) * 100.) / (
(dom.cpu_stats[0] - old_cpu_stats[0]) * 1000. * 1000. * 1000.)))
(dom.cpu_stats[0] - old_cpu_stats[0]) * 1000. * 1000. * 1000.) / vcpu))
@_vir_tag
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment