-
Notifications
You must be signed in to change notification settings - Fork 821
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
feat: exponential histogram - part 1 - mapping functions #3504
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3504 +/- ##
==========================================
+ Coverage 93.80% 93.88% +0.07%
==========================================
Files 249 255 +6
Lines 7640 7754 +114
Branches 1589 1609 +20
==========================================
+ Hits 7167 7280 +113
- Misses 473 474 +1
|
88cd0f3
to
7969c06
Compare
7969c06
to
8ec90ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly nits. Thanks for putting in the work on this.
packages/sdk-metrics/src/aggregator/exponential-histogram/mapping/ieee754.ts
Outdated
Show resolved
Hide resolved
packages/sdk-metrics/src/aggregator/exponential-histogram/mapping/types.ts
Show resolved
Hide resolved
packages/sdk-metrics/src/aggregator/exponential-histogram/mapping/ieee754.ts
Outdated
Show resolved
Hide resolved
packages/sdk-metrics/src/aggregator/exponential-histogram/mapping/LogarithmMapping.ts
Outdated
Show resolved
Hide resolved
packages/sdk-metrics/src/aggregator/exponential-histogram/mapping/LogarithmMapping.ts
Outdated
Show resolved
Hide resolved
packages/sdk-metrics/src/aggregator/exponential-histogram/mapping/ExponentMapping.ts
Outdated
Show resolved
Hide resolved
packages/sdk-metrics/src/aggregator/exponential-histogram/mapping/LogarithmMapping.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 🚀 Thank you for implementing this 🙂
Was only able to come up with a few optional nits. 🙂
packages/sdk-metrics/src/aggregator/exponential-histogram/mapping/ExponentMapping.ts
Outdated
Show resolved
Hide resolved
packages/sdk-metrics/src/aggregator/exponential-histogram/mapping/ExponentMapping.ts
Outdated
Show resolved
Hide resolved
packages/sdk-metrics/src/aggregator/exponential-histogram/mapping/ExponentMapping.ts
Outdated
Show resolved
Hide resolved
packages/sdk-metrics/src/aggregator/exponential-histogram/mapping/ieee754.ts
Outdated
Show resolved
Hide resolved
packages/sdk-metrics/src/aggregator/exponential-histogram/mapping/ieee754.ts
Outdated
Show resolved
Hide resolved
packages/sdk-metrics/test/aggregator/exponential-histogram/LogarithmMapping.test.ts
Outdated
Show resolved
Hide resolved
packages/sdk-metrics/test/aggregator/exponential-histogram/helpers.ts
Outdated
Show resolved
Hide resolved
packages/sdk-metrics/test/aggregator/exponential-histogram/helpers.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Marc Pichler <[email protected]> Co-authored-by: Daniel Dyla <[email protected]>
Which problem is this PR solving?
This PR is part 1 in a series of PRs to add exponential histogram support.
Partially Fixes #3324
Short description of the changes
This PR adds the mapping functions that will be used map values to buckets across the range of usable scales. The scales range from -10 to 20 with higher numbers giving higher resolution. These are not user facing, and will be used internally by the
ExponentialHistogramAccumulation
to maintain the highest resolution given its max size and range of values observed. The histogram will use theExponentMapping
for scales [-10, 0] and theLogarithmMapping
for scales [1, 20]. The Accumulation will start out at max resolution (scale 20) and downscale as needed. It's possible to fit the entire floating point range in two buckets at scale -10, which is the minimum size allowed size for theExponentialHistogramAccumulation
.This code is heavily based on the Golang reference implementation. For other details see:
For the other PRs in this series see:
You can see all 3 PRs combined in the original draft PR
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: