[Feature request] Display bytes transferred when updating <crates.io> index #8483
Labels
A-console-output
Area: Terminal output, colors, progress bar, etc.
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Describe the problem you are trying to solve
When updating an index such as crates.io on a slow network connection (e.g. tethering from a mobile device), the "Fetch" step is often quite slow. In particular on a fresh install of Cargo this is often the slowest step.
For now, there is a progress bar showing a percentage of progress, such as the following.
However, this percentage is quite opaque.
Describe the solution you'd like
It would be useful to also display:
Notes
I believe the relevant code that updates the progress bar is the following:
cargo/src/cargo/sources/git/utils.rs
Lines 693 to 697 in f12d72e
In particular, the relevant information (
stats
) seem to come from a callback from libgit2 (git2::Progress). This struct already contains areceived_bytes()
which would provide information for (1). I'm not sure how to get the total/remaining bytes from libgit2, nor the throughput. But seeing how many bytes have been transferred would already be a great improvement.The text was updated successfully, but these errors were encountered: