Skip to content

frontend: Use linux2rest network probe deltas for tray rates#4028

Open
joaoantoniocardoso wants to merge 1 commit into
masterfrom
pr/network-txrx-sampler-rates
Open

frontend: Use linux2rest network probe deltas for tray rates#4028
joaoantoniocardoso wants to merge 1 commit into
masterfrom
pr/network-txrx-sampler-rates

Conversation

@joaoantoniocardoso

@joaoantoniocardoso joaoantoniocardoso commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Derive tray upload/download speeds from linux2rest received_B / transmitted_B (sysinfo per-sample deltas) divided by the Sampler interval (5s), instead of re-differencing total_* across frontend polls.
  • That removes negative Mbps when totals reset and avoids flicker/spikes against the ≥0.9 sample cache.
  • NetworkCard now shows probe deltas alongside totals (same shape as linux2rest's own UI).
  • Also fixes the transmitted_B type docstring (was copy-pasted as "bytes received"), swaps the swapped mdi-cloud-upload/mdi-cloud-download icons on the byte rows, and rewords labels to Packets received/transmitted.

Closes #3587

Note: The target is BlueOS 1.5 only.

Test plan

  • Against BlueOS with linux2rest 0.9.x: enable eth0 Networking widget under steady traffic
  • Rate stays stable across 2s polls within a 5s sample window (no flicker to 0)
  • Rate updates when the Sampler advances; never goes negative
  • System Information → Network cards show delta / total for packets and bytes
  • Byte-row icons match direction (download on received, upload on transmitted)

@joaoantoniocardoso
joaoantoniocardoso force-pushed the pr/network-txrx-sampler-rates branch 2 times, most recently from 731c8f3 to 0c958ba Compare July 25, 2026 15:38
@joaoantoniocardoso joaoantoniocardoso changed the title frontend: Fix TX/RX rates under linux2rest 0.9 sampler cache frontend: Use linux2rest network probe deltas for tray rates Jul 25, 2026
@joaoantoniocardoso
joaoantoniocardoso marked this pull request as draft July 25, 2026 15:51
@joaoantoniocardoso
joaoantoniocardoso marked this pull request as ready for review July 25, 2026 15:51
@bluerobotics bluerobotics deleted a comment from github-actions Bot Jul 25, 2026
@joaoantoniocardoso
joaoantoniocardoso marked this pull request as draft July 25, 2026 16:14
@joaoantoniocardoso
joaoantoniocardoso marked this pull request as ready for review July 25, 2026 16:14
@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown

Automated PR Review

0. Summary

  • Verdict: LGTM :shipit:

Switches the Networking widget's upload/download rates from a frontend re-diff of total_*_B counters to the per-sample received_B / transmitted_B deltas exposed by linux2rest, dividing by the (hardcoded, documented) 5s Sampler interval. This eliminates the negative-Mbps window during counter resets and the flicker/zeroing that occurred whenever the 2s frontend poll landed inside the same 5s linux2rest sample cache. Also drops the now-unused Network.last_update field, corrects the transmitted_B JSDoc (was copy-pasted as "bytes received"), swaps the inverted mdi-cloud-upload / mdi-cloud-download icons on the byte rows in NetworkCard.vue, and adds the per-sample delta alongside the running total.

No further comments, nice job 👍

Generated by PR Review Bot. This is advisory, a human reviewer must still approve.

@joaoantoniocardoso
joaoantoniocardoso force-pushed the pr/network-txrx-sampler-rates branch from 0c958ba to aaf8e9a Compare July 25, 2026 16:21
@joaoantoniocardoso
joaoantoniocardoso marked this pull request as draft July 25, 2026 16:23
@joaoantoniocardoso
joaoantoniocardoso marked this pull request as ready for review July 25, 2026 16:23
@joaoantoniocardoso

Copy link
Copy Markdown
Member Author

Addressed from the latest review:

  • Clamp at source in networkProbeRateBps (formatter stays pure)
  • camelCase bytesSinceLastProbe
  • Consistent NetworkCard labels (Packets received/transmitted)

Deferred / intentional:

  • Hardcoded 5 s Sampler interval → follow-up (expose from linux2rest or derive from unix_time_seconds)
  • First-sample 0.00Mbps until the first non-zero delta window is intentional
  • Disk-rate unification out of scope here

Map tray upload/download speeds from received_B/transmitted_B divided by
the linux2rest Sampler interval instead of re-differencing total_* across
frontend polls. Show the same probe deltas on NetworkCard.
@joaoantoniocardoso
joaoantoniocardoso force-pushed the pr/network-txrx-sampler-rates branch from aaf8e9a to ee4d6a5 Compare July 25, 2026 16:32
@joaoantoniocardoso
joaoantoniocardoso marked this pull request as draft July 25, 2026 16:32
@joaoantoniocardoso
joaoantoniocardoso marked this pull request as ready for review July 25, 2026 16:32
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.

Negative bandwidth (?)

1 participant