1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-09 11:46:49 +00:00

fix(instances): the new-VM dialog shows each host's current CPU load

The CPU bar showed the average since the host booted, read for every
compute on every load of the VM list. The dialog now reads each compute's
graph endpoint (load over one second) when it opens, two computes at a
time so the reads hold at most two workers, and ignores answers of an
earlier opening. A host that cannot be read shows a dash. The since-boot
reading had no other caller and is removed.
This commit is contained in:
catborise 2026-10-10 16:34:13 +03:00
parent c1d2e9610d
commit a57290cdf2
11 changed files with 170 additions and 24 deletions

View file

@ -66,10 +66,6 @@ class CpuUsageTestCase(UnitTestCase):
clock.sleep.assert_called_once_with(1)
self.assertEqual((usage["usage"], usage["window"]), (80.0, 1.0))
def test_since_the_host_started(self, clock):
self.assertEqual(host((25, 75)).get_cpu_usage(diff=False), {"usage": 75.0})
clock.sleep.assert_not_called()
class GraphTestCase(TestCase):
def setUp(self):