mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-01 16:36:06 +00:00
perf(vrtManager): a pool's size is read with one info call
get_size() called pool.info() twice for its capacity and free space, two libvirt calls on every pool page and API read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
parent
235b4ad285
commit
7b5ccff8f5
2 changed files with 8 additions and 1 deletions
|
|
@ -285,6 +285,12 @@ class VolumesTestCase(unittest.TestCase):
|
|||
stg.pool.storageVolLookupByName.return_value = volume("a.img", 4096, 0, "raw")
|
||||
self.assertEqual(stg.get_volume_details("a.img"), {"name": "a.img", "size": 4096, "allocation": 0, "type": "raw"})
|
||||
|
||||
def test_the_pool_size_is_one_info_call(self):
|
||||
stg = self.storage([])
|
||||
stg.pool.info.return_value = [2, 500, 380, 120]
|
||||
self.assertEqual(stg.get_size(), [500, 120])
|
||||
stg.pool.info.assert_called_once_with()
|
||||
|
||||
|
||||
def host(*readings):
|
||||
"""A wvmHostDetails whose getCPUStats returns readings, (idle, busy) each."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue