Skip to content

v0.1.10

Choose a tag to compare

@ralyodio ralyodio released this 04 Sep 08:41
82c496c

Partial release. This tag published @profullstack/hqtui@0.1.10 but the demo publish failed in its prepublish build. @profullstack/hqtui-demo never reached 0.1.10. Use v0.1.11, which carries the same demo fixes and the build fix.

The demo's collection loop was written for a short session and misbehaved over a long uptime. This release fixes four ways it did, all found and fixed by Tripp Josserand-Austin (@anjaustin) in #25, landed as #30.

The demo

Refreshes no longer stack. The interval timer fired collector.refresh() unconditionally and discarded the promise. A refresh can outrun the interval, since the tick-15 path alone allows journalctl five seconds, and every concurrent call mutated the same sample, the same previous-counter state behind every rate, and the same tick counter driving the staggered cadences, each spawning its own ps, ss, df and journalctl. One refresh runs at a time now.

--interval is bounded at both ends. Node resets any timer delay outside 1 to 2^31-1 milliseconds, and also NaN and Infinity, to one millisecond. The old floor-only clamp let --interval 1e12 run a one-millisecond loop that forked two thousand processes in three seconds, and --interval Infinity made every derived rate NaN. The parser lives in its own module so it can be tested without starting the dashboard.

Rates use the time that actually passed. Every counter delta was divided by the interval that was asked for rather than the gap since the previous refresh, so a refresh that outran its tick overstated disk throughput, network up and down, per-interface rx and tx, context switches, interrupts and forks by the skip factor. Measured now, the worst error is 0.0% where it was 100%.

Departed interfaces are pruned. The per-interface history and the previous-counter map were keyed by name and never cleaned. On a container host the veth* names churn constantly and each retained entry held two 240-element arrays. Both maps are pruned to what /proc/net/dev still lists. An interface that flaps restarts its sparkline, which is the one visible consequence.

The library

No changes. @profullstack/hqtui is republished at 0.1.10 so the two packages stay on one version, which the publish workflow requires.

Upgrading

npm install @profullstack/hqtui@0.1.10
npx @profullstack/hqtui-demo@0.1.10

This is the first release cut through the publish workflow rather than by hand.