Skip to content

feat: add CPU load average to device metrics and dashboard#61

Merged
KMX415 merged 2 commits into
KMX415:mainfrom
ryannzander:main
May 31, 2026
Merged

feat: add CPU load average to device metrics and dashboard#61
KMX415 merged 2 commits into
KMX415:mainfrom
ryannzander:main

Conversation

@ryannzander
Copy link
Copy Markdown
Contributor

Summary

Adds the system 1/5/15-minute load average to the device metrics endpoint and
surfaces it as a new "Load Avg" card on the dashboard system stats row.

  • Backend: new _read_load_avg() helper reads /proc/loadavg; GET /api/device/metrics
    now returns "load_avg": [1m, 5m, 15m] (or null on non-Linux hosts).
  • Frontend: new Load Avg stat card showing the 1-min value with 5m · 15m sub-line,
    falling back to N/A when unavailable — mirrors the existing CPU Temp card.
  • Tests: 3 unit tests covering valid parse, missing file, and malformed content.

Why

Load average is a standard, low-overhead health signal that complements the existing
CPU%, RAM, disk, and temperature stats — useful for spotting sustained load on
resource-constrained Pi devices without opening a shell.

Type

  • Bug fix
  • Feature
  • Docs
  • Refactor
  • UI
  • Installer
  • Region support
  • Hardware change

Testing

Added unit tests for the /proc/loadavg parser (pass via python -m unittest).
Backend/JS changes follow the existing metrics + stat-card patterns. Not yet run on
Pi hardware; load values render N/A on Windows since /proc/loadavg is absent there.

  • Local only
  • Tested on hardware
  • Dashboard tested
  • Docs only
  • UI only

Hardware:

  • Pi: not tested on hardware
  • Concentrator: n/a
  • Node/radio: n/a
  • Region: n/a
  • OS: developed on Windows 11 (Linux-only code path verified by unit tests)

Impact

Does this affect:

  • Parsing
  • Relay
  • TX
  • Radio driver
  • Region logic
  • UI only
  • Installer only

Notes: Additive only — one new key on /api/device/metrics and one new dashboard
card. No changes to existing metric fields, packet handling, or radio paths.

AI-assisted?

  • No
  • Yes

If yes, how: Reviewed works and tested with Claude Code (Anthropic). Author wrote main cod, reviewed bug fixes, and understands all changes being made.

@KMX415 KMX415 merged commit 91046fe into KMX415:main May 31, 2026
1 check passed
@KMX415
Copy link
Copy Markdown
Owner

KMX415 commented May 31, 2026

Thanks for the PR, Ryan. Tested on a RAK V2 — load average card and metrics look good. Merged to \main; this will ship in the v0.7.5 release (no separate patch version).

KMX415 added a commit that referenced this pull request May 31, 2026
Resolve CHANGELOG and app.js conflicts: keep v0.7.5 CPU temp display and wire Load Avg card from PR #61.
@ryannzander
Copy link
Copy Markdown
Contributor Author

Thank you!

KMX415 added a commit that referenced this pull request Jun 1, 2026
Version bump, CHANGELOG cut, and update-channel housekeeping (rc-076 / feat/v0.7.6). Includes PR #61 load average merged on main. 854 tests passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants