Skip to content

Commit

Permalink
The number of centroids is defined as <= the number of samples inserted.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@dblock.org>
  • Loading branch information
dblock committed Jun 21, 2022
1 parent 37651e9 commit 6b03882
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ protected InternalTDigestPercentiles createTestInstance(
final TDigestState state = new TDigestState(100);
Arrays.stream(values).forEach(state::add);

assertEquals(state.centroidCount(), values.length);
// the number of centroids is defined as <= the number of samples inserted
assertTrue(state.centroidCount() <= values.length);
return new InternalTDigestPercentiles(name, percents, state, keyed, format, metadata);
}

Expand Down

0 comments on commit 6b03882

Please sign in to comment.