Repository navigation
fix(cli): show bundle-pull speed and ETA on the total bar, not per file - #2004
Merged
Merged
Conversation
With `--jobs` pulls sharing one link, a per-file rate is only that lane's share of the bandwidth and its ETA reads as stuck whenever another file has the link. Move the rate/ETA readout to the bottom total bar, computed from total content bytes with the same time-weighted moving average `decdn fetch` uses; per-file bars keep only their byte counts. Already-present files credited to the total shift the meter's baseline without feeding the rate, so a resumed run reports transfer speed rather than disk speed. The smoothing math is extracted into `SpeedState::observe` so both commands share one estimator, and the fetch callback drops its dead delta-forwarding parameter. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The functional changes are cohesive and well-tested; only a minor documentation typo remains.
Pull request overview
This PR improves decdn bundle pull progress reporting by moving speed/ETA to the bottom total bar (whole-download throughput) and simplifying per-file bars to show bytes only, avoiding misleading per-file rate/ETA when --jobs shares bandwidth.
Changes:
- Introduces a
TotalBarwrapper inpull_progress.rsto own the total progress bar plus a shared rate/ETA estimator, with a separate “credit” path for already-present bytes that should not affect transfer rate. - Refactors the existing rate smoothing logic in
fetch.rsintoSpeedState::observe(andshift) so it can be reused by bothfetchandbundle pull. - Updates the labeled per-file progress bar template to remove the
{msg}slot (rate/ETA), and removes the no-longer-used delta-forwarding hook from the fetch-side callback.
File summaries
| File | Description |
|---|---|
| crates/cli/src/commands/pull_progress.rs | Adds TotalBar (total-only rate/ETA) and updates per-file callbacks to position-only updates while folding scaled progress into the total. |
| crates/cli/src/commands/fetch.rs | Extracts shared speed/ETA estimator (SpeedState::observe/shift) and simplifies per-file bar rendering and callback wiring. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Coverage reportTotal: 82.77% (was 82.74%, ▲ +0.03%) — 77204/93275 lines
History
|
… renders Co-Authored-By: Claude Fable 5.1 <[email protected]>
4 tasks done
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
With
--jobspulls sharing one link, a per-file rate is only that lane's share of the bandwidth and its ETA reads as stuck whenever another file has the link. This moves the rate/ETA readout to the bottom total bar, computed from total content bytes, and leaves per-file bars with just their byte counts.pull_progress.rs: the total bar is wrapped in aTotalBarthat owns a rate meter. Every transferred increment folded into the total samples the meter and rewrites the bar's{msg}as(rate, ETA). Bytes credited for already-present files move the bar but shift the meter's baseline instead of feeding it, so a resumed run reports transfer speed, not disk speed.fetch.rs: the existing smoothing math is extracted intoSpeedState::observeso single-blobfetchandbundle pullshare one estimator. The per-file bar template loses its rate slot, and the fetch callback drops its dead delta-forwarding parameter (its docstring described a total-bar design that no longer exists).Test plan
cargo clippy -p decdn-cli --all-targets --all-features -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc -p decdn-cli --no-deps --document-private-itemscargo nextest run -p decdn-cli(650 passed; 3 new tests: rate-free file callback, total-bar message, skipped credit does not leak into the rate)decdn bundle pullwith--jobs > 1: total bar shows a moving rate/ETA while file bars show bytes only🤖 Generated with Claude Code