mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 17:36:05 +00:00
perf(computes): a host's CPU count and memory come from its cached info
cpu_count and ram_size each called get_node_info(), which also reads the hostname, the sysinfo XML and the URI, for one value. Both now take it from host_info, the getInfo() read the proxy keeps.
This commit is contained in:
parent
7be3a1b1d7
commit
7c408673a1
2 changed files with 9 additions and 3 deletions
|
|
@ -90,11 +90,11 @@ class Compute(Model):
|
|||
|
||||
@cached_property
|
||||
def cpu_count(self):
|
||||
return self.proxy.get_node_info()[3]
|
||||
|
||||
return self.proxy.host_info[2]
|
||||
|
||||
@cached_property
|
||||
def ram_size(self):
|
||||
return self.proxy.get_node_info()[2]
|
||||
return self.proxy.host_info[1] * 1048576 # MiB
|
||||
|
||||
@cached_property
|
||||
def ram_usage(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue