Skip to content

chore(ux): optimize progress bar#1349

Merged
qweeah merged 9 commits into
oras-project:mainfrom
qweeah:negative-speed
Apr 17, 2024
Merged

chore(ux): optimize progress bar#1349
qweeah merged 9 commits into
oras-project:mainfrom
qweeah:negative-speed

Conversation

@qweeah

@qweeah qweeah commented Apr 16, 2024

Copy link
Copy Markdown
Contributor

This PR

  1. Adds defensive code to avoid showing negative speed in progress bar.
  2. Calculates the download speed based on the size of transferred data in the past last seconds.

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@codecov

codecov Bot commented Apr 16, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.70%. Comparing base (7ffe63e) to head (84c4cb3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1349      +/-   ##
==========================================
+ Coverage   84.49%   84.70%   +0.20%     
==========================================
  Files         103      104       +1     
  Lines        3677     3688      +11     
==========================================
+ Hits         3107     3124      +17     
+ Misses        340      336       -4     
+ Partials      230      228       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

qweeah added 2 commits April 16, 2024 07:35
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@qweeah qweeah changed the title fix: avoid showing negative speed in progress bar chore(ux): optimize progress bar Apr 16, 2024
qweeah added 2 commits April 16, 2024 08:00
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Comment thread cmd/oras/internal/display/status/progress/speed.go Outdated

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qweeah qweeah merged commit 2edebad into oras-project:main Apr 17, 2024
FeynmanZhou pushed a commit to FeynmanZhou/oras that referenced this pull request May 11, 2024
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
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.

2 participants