Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: progress rates were overcounted by 5x #3919

Merged
merged 5 commits into from
Feb 6, 2024
Merged

Conversation

lemmih
Copy link
Contributor

@lemmih lemmih commented Jan 30, 2024

Summary of changes

Changes introduced in this pull request:

  • Divide by time_in_seconds to get the real progress in units per second.

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

@lemmih lemmih marked this pull request as ready for review January 30, 2024 12:19
@lemmih lemmih requested a review from a team as a code owner January 30, 2024 12:19
@lemmih lemmih requested review from ruseinov and hanabi1224 and removed request for a team January 30, 2024 12:19
LesnyRumcajs
LesnyRumcajs previously approved these changes Jan 30, 2024
@LesnyRumcajs LesnyRumcajs dismissed their stale review January 30, 2024 12:45

no green checkmark!

@@ -233,14 +235,14 @@ mod tests {
progress.last_logged_items = 1024 * 1024 * 1024 / 3;
assert_eq!(
progress.msg(now + Duration::from_secs(125)),
"test 512 MiB / 1 GiB, 50%, 170.7 MiB/s, elapsed time: 2m 5s"
"test 512 MiB / 1 GiB, 50%, 1.4 MiB/s, elapsed time: 2m 5s"
Copy link
Member

Choose a reason for hiding this comment

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

Could you please explain why the speed is 1.4 MiB/s? It'd be nice to have a comment with the math regarding the expectations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adding comments, that helps.

src/utils/io/progress_log.rs Outdated Show resolved Hide resolved
Co-authored-by: Hubert <hubert@chainsafe.io>
@lemmih lemmih added this pull request to the merge queue Feb 6, 2024
Merged via the queue into main with commit 182e7a3 Feb 6, 2024
28 checks passed
@lemmih lemmih deleted the lemmih/fix-rate-logging branch February 6, 2024 10:15
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.

None yet

4 participants