Repository navigation
Feature: read the throughput row from the chosen source - #126
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
networkobject once per source, sharing the key with ashowIfonstatProvider, adding aninterfacepicker fed by aninterfacesendpoint to the three remote copies.throughputendpoint dispatched onstatProvider; the view calls it whenever the source is not this machine, and keeps the cached/api/network-statsreading otherwise.bytes_recv_rate_per_sec, falling back to the window and itstime_since_updatefor version 3.bas the whole host's rate, and derive a per-interface rate from thenitotals.bytesReceivedandbytesSentinmetrics.network.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