containers / image

Work with containers' images
Apache License 2.0
866 stars 377 forks source link

Image download rate statistics #1133

Open YuviGold opened 3 years ago

YuviGold commented 3 years ago

Currently, in case anyone would want to calculate image pull speed, he would have to

  1. Wrap time calculation for pull operation.
  2. Inspect the image size.
  3. Divide them and calculate the download speed.

But this is the best-case scenario. It doesn't take into account caching, failures, compression, etc.

I suggest adding a new feature for notifying about the download rate of each layer to the user. Either by a new operation(which requires saving those statistics to be gathered later on) or by real-time debug logs of the pull operation.

/cc @vrothberg

mtrmac commented 3 years ago

Thanks for your report.

Ideally this data could be provided via copy.Options.Progress, not (or at least not primarily) as a plain text in a log stream.

That channel does currently provide “offset” + blob ID, so a reader maintaining its own timestamp can calculate instantaneous speed; but it does not provide metadata like list of layers to copy and expected size that would allow to make a prediction of remaining time.