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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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