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

Upgraded to t-digest 3.3. #3634

Merged
merged 8 commits into from
Jun 24, 2022
Prev Previous commit
Next Next commit
Fixed more unit tests.
Signed-off-by: dblock <dblock@dblock.org>
  • Loading branch information
dblock committed Jun 21, 2022
commit bb9e8f2076d1063e9431e19a722841ae81642620
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ public void testSomeMatchesSortedNumericDocValues() throws IOException {
}, tdigest -> {
assertEquals(7L, tdigest.state.size());
assertEquals(7L, tdigest.state.centroidCount());
assertEquals(4.5d, tdigest.percentile(75), 0.0d);
assertEquals("4.5", tdigest.percentileAsString(75));
assertEquals(5.0d, tdigest.percentile(75), 0.0d);
assertEquals("5.0", tdigest.percentileAsString(75));
assertEquals(3.0d, tdigest.percentile(71), 0.0d);
assertEquals("3.0", tdigest.percentileAsString(71));
assertEquals(2.0d, tdigest.percentile(50), 0.0d);
assertEquals("2.0", tdigest.percentileAsString(50));
assertEquals(1.0d, tdigest.percentile(22), 0.0d);
Expand All @@ -126,11 +128,11 @@ public void testSomeMatchesNumericDocValues() throws IOException {
iw.addDocument(singleton(new NumericDocValuesField("number", 0)));
}, tdigest -> {
assertEquals(tdigest.state.size(), 7L);
assertEquals(tdigest.state.centroidCount(), 7L);
assertTrue(tdigest.state.centroidCount() <= 7L);
assertEquals(8.0d, tdigest.percentile(100), 0.0d);
assertEquals("8.0", tdigest.percentileAsString(100));
assertEquals(6.98d, tdigest.percentile(88), 0.0d);
assertEquals("6.98", tdigest.percentileAsString(88));
assertEquals(8.0d, tdigest.percentile(88), 0.0d);
assertEquals("8.0", tdigest.percentileAsString(88));
assertEquals(1.0d, tdigest.percentile(33), 0.0d);
assertEquals("1.0", tdigest.percentileAsString(33));
assertEquals(1.0d, tdigest.percentile(25), 0.0d);
Expand All @@ -157,7 +159,7 @@ public void testQueryFiltering() throws IOException {
assertEquals(4L, tdigest.state.centroidCount());
assertEquals(2.0d, tdigest.percentile(100), 0.0d);
assertEquals(1.0d, tdigest.percentile(50), 0.0d);
assertEquals(0.5d, tdigest.percentile(25), 0.0d);
assertEquals(1.0d, tdigest.percentile(25), 0.0d);
assertTrue(AggregationInspectionHelper.hasValue(tdigest));
});

Expand Down