Files
glances/tests
nicolargo 656d902585 fix(v5): guard against psutil's no-baseline first cpu_times_percent sample
psutil.cpu_times_percent(interval=0.0) requires two anchor points to
compute a delta. Before the second anchor is laid down (~1 ms after the
first), it returns either all zeros or a partial sample like
(idle=1.0, every other field=0.0). The cpu plugin computes
total = 100 - idle, so an unsettled sample produces total=99-100% — a
visible spike that persists for one TTL window (1 s by default) after
startup, while v4 stays at the real value because CpuPercent primes
psutil in __init__.

Sampler-level fix: detect unsettled samples (sum of time-percent
fields < 50%), sleep 50 ms, and re-sample once before caching. The
guard runs inside the asyncio lock so concurrent get_aggregate calls
share the same retry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 16:00:57 +02:00
..
2026-03-24 08:18:04 +00:00
2026-02-21 21:18:27 +01:00
2026-03-24 08:18:04 +00:00
2025-12-26 18:47:01 +01:00
2025-12-26 18:47:01 +01:00
2026-05-07 12:59:37 +00:00
2026-02-26 21:55:37 +01:00
2026-03-24 08:18:04 +00:00
2026-03-24 08:18:04 +00:00
2026-05-12 11:31:05 +02:00
2026-03-24 08:18:04 +00:00