-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Switch percentiles implementation to MergingDigest #18124
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
Switch percentiles implementation to MergingDigest #18124
Conversation
0f72ce4
to
852c178
Compare
❌ Gradle check result for 852c178: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Peter Alfonsi <[email protected]>
852c178
to
4599cff
Compare
On further thought I will add some tests around serialization + serialization inter-version compatibility. Both classes provide their own serialization methods. Probably the most logical thing to do would be to add a version check, and for < 3.1 use the preexisting logic assuming |
❌ Gradle check result for 4599cff: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 9c83d7d: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Peter Alfonsi <[email protected]>
9c83d7d
to
0e93844
Compare
❌ Gradle check result for 0e93844: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Flaky test: #14293 |
Signed-off-by: Peter Alfonsi <[email protected]>
ff7c7da
to
955f175
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18124 +/- ##
============================================
+ Coverage 72.52% 72.56% +0.04%
- Complexity 67509 67576 +67
============================================
Files 5496 5496
Lines 311467 311546 +79
Branches 45253 45231 -22
============================================
+ Hits 225891 226076 +185
+ Misses 67180 67091 -89
+ Partials 18396 18379 -17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hm, codecov thinks the pre-3.1.0 parts of the serialization functions are not covered, but they're actually run by the BWC tests. (I know this is true because there were failures that I fixed by modifying this code). Probably this is because the test cases are coming in from .yml files rather than being run like a normal UT/IT. @msfroh I think this is ready for review now - mind taking a look when you get a chance? |
server/src/main/java/org/opensearch/search/aggregations/metrics/TDigestState.java
Show resolved
Hide resolved
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
❕ Gradle check result for f19c941: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Signed-off-by: Peter Alfonsi <[email protected]>
Hey @msfroh , any further comments or do you think we're good to merge this one? |
❕ Gradle check result for 3cea57c: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
This should be good. Someday, I'd like to revisit the histogram implementation(s) that we use, but this is already a great improvement. @yupeng9, this might be an interesting thing to keep in mind when we work on metrics. |
Signed-off-by: Peter Alfonsi <[email protected]>
Description
Switches the percentiles agg implementation from AVLTreeDigest to MergingDigest. MergingDigest is now the recommended implementation from the t-digest library, and we see significant speedups by switching to it. (See more details in the original issue). Some latencies from percentiles aggregations on http_logs:
Since the implementations extend the same abstract class
AbstractTDigest
, this is a drag-and-drop change. Our extending classTDigestState
just adds some StreamInput/StreamOutput methods, which use the result of thecentroids()
andcentroidCount()
methods which are overridden from the abstract class. I don't think we need additional tests. The existing tests in TDigestPercentilesAggregatorTests.java still pass after the change. However I will still mark this PR as a draft, please let me know if I'm missing something here...I also don't think we need any tuning of the sole parameter
compression
, since in the library's methodcreateDigest
that creates a digest of the default implementation, it doesn't modify the inputcompression
based on which implementation it's actually using.Related Issues
Resolves #18122
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.