Repository navigation
K2GO-376 fix(content-exchange): windowed transfer rate, not cumulative average - #717
Merged
Merged
Conversation
…e average The copy loop computed the shown speed as copiedTotal / elapsed-since-run-start, a cumulative average that reads far too low on a single large item that warms up slowly (the dominant Content Exchange case). Sample a short trailing window (delta bytes / delta time) inside the per-item copy loop instead, reusing the existing sampleRate helper. Applied to both import and export; the between-item sampler already windowed, so unify both on one RATE_WINDOW_MS.
…runStart sampleRate reinvented download/domain/DownloadEta.secondsRemaining; call it in both services. It also returns UNKNOWN (not a fake 0) when the plan size is unknown. runStart was a single-use alias for the lastSampleAt seed; inline it.
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.
The transfer speed shown during import/export was the cumulative average (total bytes / elapsed
since run start), so it read far too low on a single large item that warms up slowly (the common
Content Exchange case). Sample a short trailing window (delta bytes / delta time) in the per-item
copy loop instead, reusing the existing sampleRate helper; ETA follows. Applied to both import and export.
Build: app:assembleStandardDebug OK.