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

Use performance.now() where available #379

Merged
merged 1 commit into from
Jan 31, 2023
Merged

Conversation

robertodauria
Copy link
Contributor

@robertodauria robertodauria commented Jan 31, 2023

This PR changes the NDT5 client code to use the monotonic performance.now() instead of Date.now() where available. This fixes a rare bug that happens when the system clock is changed while a measurement is running, which would cause an incorrect client-side throughput to be displayed -- in extreme cases, even a negative value.

(The code is basically the same as in ndt7-js)


This change is Reviewable

Copy link
Contributor

@stephen-soltesz stephen-soltesz left a comment

Choose a reason for hiding this comment

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

:lgmt:

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 1637

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 15 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.7%) to 81.463%

Files with Coverage Reduction New Missed Lines %
ndt5/ndt5.go 2 88.95%
metrics/metrics.go 4 60.0%
ndt5/c2s/c2s.go 4 71.43%
ndt7/upload/sender/sender.go 5 65.91%
Totals Coverage Status
Change from base Build 1634: -0.7%
Covered Lines: 1815
Relevant Lines: 2228

💛 - Coveralls

@robertodauria robertodauria merged commit e113717 into main Jan 31, 2023
@robertodauria robertodauria deleted the sandbox-roberto-fix-now branch January 31, 2023 17:05
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.

3 participants