1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-01 08:26:03 +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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
catborise 2026-11-08 12:05:19 +03:00
parent 490b7efe3f
commit a1f90ec98c
2 changed files with 9 additions and 3 deletions

View file

@ -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):