Fix rate and progress calculations#2322
Merged
Merged
Conversation
The EWMA package assumes a 1s tick between invocations, meaning the average decay time was previously 15 * 30 = 7.5 minutes. Change to correct usage of package and switch average interval to 20s which causes the package to use historical averages for the startup interval.
When the transfer is resumed after a failed attempt, the progress bar should show that we are picking up where we left off, not starting again at zero.
Periodically print the transfer status to the logs to help understand how the transfer is progressing (and the estimated rate) when debugging is enabled.
Add a warning when we hit slow-transfer mode and note the concurrency calculation when we have an error.
Previously, the time elapsed was always calculated from the beginning of the transfer, not since the last progress calculation. This meant, as time went forward, the average rate went lower and lower until the transfer was cancelled due to slow rates.
Previously, if `MinimumDownloadSpeed` was not set then we would always clobber the value of `Client.MinimumDownloadSpeed` with the code defaults. This caused `Client.MinimumDownloadSpeed` to be ignored in the config file or environment.
329c498 to
7d49961
Compare
jhiemstrawisc
approved these changes
May 20, 2025
jhiemstrawisc
left a comment
Member
There was a problem hiding this comment.
Note that I rebased one small change into this, which was a change from viper.Get("Client.MinimumDownloadSpeed" to viper.Get(param.Client_MinimumDownloadSpeed.GetName())
Otherwise looks good to me. As my one comment suggests, I'll open a followup issue to move some other config params under the new Logging.Client this PR introduces.
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.
Correct various and sundry bugs around the download rate calculation, progress bars after a slow transfer timeout, and minimum download speed.