mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-09 11:46:49 +00:00
perf(computes): the host's info is read once per request
The overview read the host's info four times, now once (12 libvirt calls). A connection object keeps it next to the capabilities, and the VM page and VM stats take it from there; the VM page's cached_reads block holds only the VM's own data. Free memory is still read each time.
This commit is contained in:
parent
9adc808d26
commit
57f592df70
6 changed files with 57 additions and 32 deletions
|
|
@ -55,7 +55,7 @@ def instance(state, clock):
|
|||
proxy._read_cache = None
|
||||
proxy.instance = FakeDomain(state, clock)
|
||||
proxy._XMLDesc = lambda flags: XML
|
||||
proxy._host_info = lambda: ["x86_64", 0, 4] # 4 host CPUs
|
||||
proxy.host_info = ["x86_64", 0, 4] # 4 host CPUs
|
||||
proxy.get_status = lambda: state
|
||||
return proxy
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ class UsageTestCase(unittest.TestCase):
|
|||
proxy.instance.domain_id = 8
|
||||
|
||||
def other_host_cpus(proxy):
|
||||
proxy._host_info = lambda: ["x86_64", 0, 8]
|
||||
proxy.host_info = ["x86_64", 0, 8]
|
||||
|
||||
def nic_renamed(proxy):
|
||||
proxy._XMLDesc = lambda flags: XML.replace("vnet0", "vnet1")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue