-
Notifications
You must be signed in to change notification settings - Fork 819
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(core): stop rounding to nearest int in hrTimeTo*seconds() functions #4014
Conversation
hrTimeTo*seconds()
functions
hrTimeTo*seconds()
functions
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4014 +/- ##
=======================================
Coverage 92.31% 92.31%
=======================================
Files 321 321
Lines 9189 9189
Branches 1953 1953
=======================================
Hits 8483 8483
Misses 706 706
|
Seems like it doesn't break any tests. Have you been able to try this fork in a real world app? |
I tried it in a little test express server with the http instrumentation and it fixed the striping I mentioned in the issue. Is there a way to run the contrib repo tests against this branch? |
Not an easy way that I can think of. We could release a I am very familiar with the trace SDK and don't expect this to be a problem, but can someone with more familiarity with the metrics SDK sanity check this? @legendecas @pichlermarc |
The only call site of the conversion functions is merging two accumulations, e.g. https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/sdk-metrics/src/aggregator/LastValue.ts#L70. I believe it is fine to accept non-integer numbers here. |
Test failures
|
I'm going to land this and track the api-eol failure in #4029. |
Which problem is this PR solving?
Fixes #3986
Short description of the changes
Remove
Math.round()
calls fromhrTimeTo{Milli,Micro}seconds()
functions in order to preserve higher precision from floating point parts.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: