Skip to content

K2GO-376 fix(content-exchange): windowed transfer rate, not cumulative average - #717

Merged
luisguzman-adfa merged 2 commits into
mainfrom
fix/K2GO-376-transfer-rate-window
Nov 1, 2026
Merged

luisguzman-adfa merged 2 commits into
mainfrom
fix/K2GO-376-transfer-rate-window

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

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.

…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.
@luisguzman-adfa luisguzman-adfa changed the title Fix/k2 go 376 transfer rate window K2GO-376 fix(content-exchange): windowed transfer rate, not cumulative average Nov 1, 2026
@luisguzman-adfa
luisguzman-adfa merged commit 5ddefc8 into main Nov 1, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the fix/K2GO-376-transfer-rate-window branch November 1, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant