Repository navigation
Conversation
Support displaying live TUI traffic rates in binary IEC bytes (bytes), decimal SI bits (bits), and binary IEC bits (iec-bits) via --rate-unit, [view] rate_unit in config.toml, and the global u keybinding. Cumulative byte totals and headless JSON output remain in bytes. Assisted-By: Gemini 4
Owner
|
@l1a Thanks a lot this looks good. Could you narrow this PR to two modes, bytes (the default) and bits (decimal SI), selectable via --rate-unit and [view] rate_unit? SI bits make it easy to compare live traffic with link speeds. Let’s leave iec-bits and the u shortcut out for now. |
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
Adds configurable live traffic rate display units to the interactive TUI with three modes:
bytes(default): Binary IEC bytes per second (B/s,KiB/s,MiB/s,GiB/s)bits: Decimal SI bits per second (bps,kbps,Mbps,Gbps)iec-bits: Binary IEC bits per second (bps,Kibps,Mibps,Gibps)Users can select or switch modes from:
--rate-unit <bytes|bits|iec-bits>config.toml):[view] rate_unit = "bits"(precedence:--rate-unit>config.toml>bytes)ufrom any tab (or with the Help overlay open) to cycle modes with transient status-bar feedback;ron Overview restores the configured startup preference, and'u'still types normally into active filter queries.Cumulative byte totals (
format_bytes) and headless JSON field names (*_bytes_per_second) remain unchanged in bytes for backwards compatibility. UpdatedUSAGE.md(marked unreleased) andCHANGELOG.md(## [Unreleased]).Verification
cargo fmt --all -- --checkcargo clippy --locked --workspace --all-targets --all-features -- -D warningscargo test --locked --workspace --all-features(1,508 passed, 0 failed, 14 pre-existing privileged/live tests ignored on Linux x86_64)cargo build --locked --workspace --all-targets --releaseAlso verified interactively on Linux x86_64 against
target/release/rustnet: startup--rate-unitflags,[view] rate_unitinconfig.toml, CLI > config > default precedence,ucycling andrreset, stderr warning fallback on unknown config strings, and invalid TOML type error handling.Scope
#[allow(clippy::...)]suppressions, or rationale provided(see CONTRIBUTING.md)
## [Unreleased]section ofCHANGELOG.mdin this PR, or this change is not user-visible(see CONTRIBUTING.md)
Notes for the reviewer
braille_graph::mirrored_wave_panelpreviously had 7 parameters (Clippy'stoo_many_argumentslimit). To passrate_unitcleanly without suppressing warnings,(frac, window, time_window_seconds, rate_unit)are grouped intoMirroredPanelOptions, mirroringWavePanelOptions.format_rate_compactpreserves the existing 5-cell half-column (↓/↑) and Y-axis label budget across all three modes (B/Ki/Mi,b/kb/Mb,b/Kb/Mb). Large-value formatting (f64::MAX) divides before multiplying by 8 sosummary_ratestays finite and fixed at 16 cells.help_overlay_details.snapandhelp_overlay_host_dns.snapreflect the single-cell scrollbar shift from addingutoGLOBAL_KEYS.Assisted-By: Gemini 4), reviewed and verified locally.