Skip to content

[backport/1.4] frontend: Use linux2rest network probe deltas for tray rates - #4110

Open
joaoantoniocardoso wants to merge 1 commit into
bluerobotics:1.4-devfrom
joaoantoniocardoso:backports/1.4/network-txrx-sampler-rates
Open

[backport/1.4] frontend: Use linux2rest network probe deltas for tray rates#4110
joaoantoniocardoso wants to merge 1 commit into
bluerobotics:1.4-devfrom
joaoantoniocardoso:backports/1.4/network-txrx-sampler-rates

Conversation

@joaoantoniocardoso

@joaoantoniocardoso joaoantoniocardoso commented Aug 10, 2026

Copy link
Copy Markdown
Member

This is a backport of #4048 into 1.4.

Before (bug in sampling):

network_before.mp4

After (stable readings):

network_after.mp4

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.
@github-actions

Copy link
Copy Markdown

Automated PR Review

0. Summary

  • Verdict: MINOR SUGGESTIONS ✏️

Backport of #4048 to 1.4-dev. Replaces the frontend re-diff of total_* byte counters (which produced negative Mbps on counter resets and flickered against the linux2rest sample cache) with the per-sample received_B / transmitted_B deltas, divided by the linux2rest Sampler interval (hardcoded to 5 s). Also fixes the swapped mdi-cloud-upload/mdi-cloud-download icons on the byte rows, reworks the labels from "Received/Transmitted package" to "Packets received/transmitted", and shows delta / total alongside the totals.

Backport compatibility with 1.4-dev's older linux2rest is fine: core/tools/linux2rest/bootstrap.sh on 1.4-dev pins v0.6.5, which already exposes received_B / transmitted_B / packets_received / packets_transmitted and uses Duration::from_secs(5) for the system Sampler (matches the constant introduced here). Removal of the last_update? field from Network is safe — a grep confirms the only remaining last_update usage is on the Disk type.

8. Documentation

  • 8.1 [nit] core/frontend/src/types/system-information/system.ts:84-85 — while updating the JSDoc for received_B / transmitted_B from "package" to "linux2rest/sysinfo probe" wording, the adjacent @param packets_received / @param packets_transmitted lines still say "Number of packages received/transmitted since last probe". The template labels were reworded to "Packets" in this same PR; the JSDoc could follow suit for consistency (very drive-by, not a blocker).

9. Nitpicks / Optional

  • 9.1 [nit] core/frontend/src/store/system-information.ts:218 — "Those deltas are already saturating" reads oddly; "already windowed to the Sampler interval" or "already scoped to a 5 s window" would be clearer to future readers.
  • 9.2 [nit] core/frontend/src/utils/networking.ts:1-2 — the TODO acknowledges that LINUX2REST_SYSTEM_SAMPLE_INTERVAL_S will silently drift if linux2rest changes cadence. Given this is a backport onto a branch pinned to linux2rest v0.6.5, consider adding a comment near core/tools/linux2rest/bootstrap.sh (or wherever the version is pinned) noting that this constant must be kept in sync — makes the coupling harder to miss during a future linux2rest bump on 1.4.

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

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.

1 participant