1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 19:26:48 +00:00
webvirtcloud/static
catborise 731d14efd7 fix(instances): pages poll one request at a time, and not while hidden
The VM page polls the VM state every 5 s and, while its Stats tab is
open, the statistics every 10 s; the compute overview polls the host
graph every 5 s. All used setInterval:

- A new request went out on schedule while the previous one was still
  open. When a host goes silent, a stats request waits up to 30-45 s,
  so each open page held several sync workers at once.
- Each time the Stats tab was shown, the page made new charts and a
  new interval without stopping the old ones, and polling went on on
  the other tabs of the page.
- Hidden pages kept polling at full rate.

Measured in a browser against a test server (old code / new): Stats tab
shown 4 times, 31 s on it: 12 / 2 requests; 31 s on another tab of the
page: 12 / 0; page hidden for 31 s: 15 / 0, and the new code asks once
right after the page is shown again; with 25 s answers, at most 15 / 1
requests open at once.

static/js/poll.js repeats a request while the page is visible: the
next one 5 or 10 s after the previous answer, none while hidden, one at
once when shown again. The Stats tab makes its charts once and polls
only while shown. The answer handler runs after the poller's own
bookkeeping, so an error in it (a chart for a disk added meanwhile)
does not stop the polling. A Node test of poll.js runs with the test
suite when node is installed.
2026-10-05 16:55:50 +03:00
..
bootstrap_icons/css add white noise for static_root/staticfiles_dir problem for debug/non-debug running mode 2023-11-10 16:29:48 +03:00
css chore(frontend): upgrade Bootswatch and Bootstrap SCSS to v5.3.3 2026-09-26 23:57:02 +03:00
fonts delete old fontawesome font files 2023-08-10 11:33:58 +03:00
icon_cache add none svg to icon cache 2024-02-13 16:53:53 +03:00
js fix(instances): pages poll one request at a time, and not while hidden 2026-10-05 16:55:50 +03:00
rest_framework add white noise for static_root/staticfiles_dir problem for debug/non-debug running mode 2023-11-10 16:29:48 +03:00
favicon.ico Initial commit 2015-02-27 10:53:51 +02:00
staticfiles.json chore: purge obsolete .travis.yml and clean stale drf-yasg paths in staticfiles.json 2026-09-25 21:45:13 +03:00