Skip to content

Feature: read the throughput row from the chosen source - #126

Merged
SandObserver merged 1 commit into
mainfrom
feat/system-summary-remote-throughput
Aug 18, 2026
Merged

SandObserver merged 1 commit into
mainfrom
feat/system-summary-remote-throughput

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Declare the network object once per source, sharing the key with a showIf on statProvider, adding an interface picker fed by an interfaces endpoint to the three remote copies.
  • Add a throughput endpoint dispatched on statProvider; the view calls it whenever the source is not this machine, and keeps the cached /api/network-stats reading otherwise.
  • Read Glances' bytes_recv_rate_per_sec, falling back to the window and its time_since_update for version 3.
  • Read Beszel's b as the whole host's rate, and derive a per-interface rate from the ni totals.
  • Derive Unraid's rate from the cumulative bytesReceived and bytesSent in metrics.network.
  • Key each derived rate to when the counters were taken rather than when they were read, so a source that publishes on its own schedule is not read as idle between publications, and skip a window where a counter went backwards.
  • Poll a remote source every ten seconds instead of every three, and render a dash until a rate exists.

Testing
All green, including the Docker build. Added 13 tests covering each source's shape, the version-3 fallback, rate derivation between records, a repeated record, a reset counter, both pickers, and the configuration failures.

Verified end to end through a container against a real Glances 4.5.6, a real Beszel hub, and Unraid's own API server. That run corrected the Beszel per-interface path: its records land once a minute, so polling faster compared a record with itself and reported zero traffic. Confirmed live: Glances rates tracking a quiet interface, Beszel's host-wide rate, a real per-interface rate holding steady between records, and Unraid counters becoming a rate on the second read.

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed.
  • CHANGELOG.md updated under Unreleased if the change is user-visible.

The network row's throughput mode always read the dashboard host, so a tile
reporting a remote machine paired that machine's CPU with this one's traffic.
Throughput now follows the source, on an interface chosen from a list the source
supplies. Only this machine keeps the existing cached local reading.

Sources report traffic three different ways. Glances gives a rate, older
versions give a window and its length. Beszel gives the whole host as a rate and
each interface as totals. Unraid gives totals alone. Totals become a rate
against the previous reading, keyed to when the counters were taken rather than
when they were read: Beszel publishes once a minute, so dividing an unchanged
record by the time since the last poll reports no traffic at all.

Remote sources are read every ten seconds rather than every three, since each
tick is a call to someone else's server.
@SandObserver SandObserver added the enhancement New feature or request label Aug 18, 2026
@SandObserver
SandObserver merged commit 3437892 into main Aug 18, 2026
4 checks passed
@SandObserver
SandObserver deleted the feat/system-summary-remote-throughput branch August 18, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant