Skip to content

feat(download): aggregate ETA — windowed / smoothed throughput #456

Description

@rejifald

BatchProgress.eta is computed from an overall-average rate (loaded / elapsedSinceFirstByte). A long stall or a slow tail therefore drags the average down and inflates the ETA for the whole batch, even while healthy items are streaming fast.

Proposal

Compute the rate over a moving window (or an EWMA) so the ETA reflects recent throughput. Keep it deterministic under the injected ClockProgressAggregator already takes one, so the manualClock unit tests in download-batch-progress.spec.ts extend cleanly.

Note: aggregate total also under-counts while items are still queued (sizes unknown until they start), so early ETAs are optimistic — a caller-supplied or HEAD-probed size could firm that up (larger, separate scope).

Introduced alongside #451; P8 / P17 in the rig spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions