mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-08 11:16:47 +00:00
Each open VM page asks for its statistics every 10 seconds. For a running VM the stats view measured the CPU, then each disk, then each NIC, sleeping one second for each. With two disks and a NIC a request held a sync gunicorn worker for over 4 s, so a few dozen open VM pages could keep every worker busy. wvmInstance.usage() replaces cpu_usage, disk_usage and net_usage, the stats view's only callers: it reads all counters, sleeps one second once and reads them again. Values and units are unchanged (CPU percent of the host, disk bytes, network bits per second); compared against the previous methods on the same counters, the results are identical. Measured on the test host for a running VM with two disks and a NIC: the stats request took 4.1-4.3 s before, 1.1-1.3 s now. The new test fails on the previous code. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| connection.py | ||
| create.py | ||
| hostdetails.py | ||
| instance.py | ||
| interface.py | ||
| libvirt-ssh | ||
| network.py | ||
| nwfilters.py | ||
| rwlock.py | ||
| storage.py | ||
| test_change_network.py | ||
| test_connection.py | ||
| test_console_setters.py | ||
| test_iso_media.py | ||
| test_live_connection.py | ||
| test_network_ip.py | ||
| test_persistent_edits.py | ||
| test_resize_disk.py | ||
| test_rwlock.py | ||
| test_usage.py | ||
| test_util.py | ||
| test_xml_safety.py | ||
| util.py | ||
| virtsecrets.py | ||