Skip to content

Download speed display shows last reported value instead of average after finishing #10633

Open
@ssiano

Description

@ssiano

Description

The pip wheel download speed seems to be reported incorrectly, as shown here in my download_speed venv:

ss@ld:~/venv/PY3/download_speed$ pip list
Package    Version
---------- -------
pip        21.3.1
setuptools 58.5.1
wheel      0.37.0
(download_speed) 

ss@ld:~/venv/PY3/download_speed$ pip wheel torch==1.9.0
Looking in indexes: https://pypi.COMPANY.com/simple/
Collecting torch==1.9.0
  Downloading https://pypi.COMPANY.com/packages/packages/a1/1f/a372f2e9f0a54fc479fcee3ac072f8cd5091054e9d7293dd4372338e5277/torch-1.9.0-cp36-cp36m-manylinux1_x86_64.whl (831.4 MB)
     |████████████████████████████████| 831.4 MB 58 kB/s               
Collecting typing-extensions
  Downloading https://pypi.COMPANY.com/packages/packages/74/60/18783336cc7fcdd95dae91d73477830aa53f5d3181ae4fe20491d7fc3199/typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)
Collecting dataclasses
  Downloading https://pypi.COMPANY.com/packages/packages/fe/ca/75fac5856ab5cfa51bbbcefa250182e50441074fdc3f803f6e76451fab43/dataclasses-0.8-py3-none-any.whl (19 kB)
Saved ./torch-1.9.0-cp36-cp36m-manylinux1_x86_64.whl
Saved ./dataclasses-0.8-py3-none-any.whl
Saved ./typing_extensions-3.10.0.2-py3-none-any.whl
(download_speed)

During the download, the speed was reported to be around 100 MB/s, and the download took around 10 seconds, but right as the download finished, the speed value changed to 58 kB/s.

Here's the same, but using time:

ss@ld:~/venv/PY3/download_speed$ time pip wheel torch==1.9.0
Looking in indexes: https://pypi.COMPANY.com/simple/
Collecting torch==1.9.0
  Downloading https://pypi.COMPANY.com/packages/packages/a1/1f/a372f2e9f0a54fc479fcee3ac072f8cd5091054e9d7293dd4372338e5277/torch-1.9.0-cp36-cp36m-manylinux1_x86_64.whl (831.4 MB)
     |████████████████████████████████| 831.4 MB 58 kB/s               
Collecting dataclasses
  Downloading https://pypi.COMPANY.com/packages/packages/fe/ca/75fac5856ab5cfa51bbbcefa250182e50441074fdc3f803f6e76451fab43/dataclasses-0.8-py3-none-any.whl (19 kB)
Collecting typing-extensions
  Downloading https://pypi.COMPANY.com/packages/packages/74/60/18783336cc7fcdd95dae91d73477830aa53f5d3181ae4fe20491d7fc3199/typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)
Saved ./torch-1.9.0-cp36-cp36m-manylinux1_x86_64.whl
Saved ./dataclasses-0.8-py3-none-any.whl
Saved ./typing_extensions-3.10.0.2-py3-none-any.whl

real    0m11.480s
user    0m7.084s
sys     0m2.468s
(download_speed)

Again, the speed was about 100 MB/s, but the output is showing 58 kB/s.

Expected behavior

I would expect the output to show the correct download speed, e.g.,

338e5277/torch-1.9.0-cp36-cp36m-manylinux1_x86_64.whl (831.4 MB)
     |████████████████████████████████| 831.4 MB 100 MB/s

pip version

21.3.1

Python version

3.6.8

OS

Linux 4.4.0-206-generic #238~14.04.1-Ubuntu SMP Wed Mar 17 06:45:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

How to Reproduce

pip wheel torch==1.9.0

If the wheel is not downloaded, then you may need to do pip cache purge first.

Output

No response

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: downloadAbout fetching data from PyPI and other sourcesUXUser experience relatedstate: awaiting PRFeature discussed, PR is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions