Skip to content
Snippets Groups Projects
Commit 3aa5c928 authored by Anael Beutot's avatar Anael Beutot
Browse files

Reference virt.

parent ef83bc0c
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ def cpuuse(dom):
return None
old_cpu_stats = dom.cpu_stats
dom.cpu_stats = (dom.hypervisor.handler.main.evloop.now(), cpu_time)
# calculate CPU percentage
# 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.)))
......
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