use of org.elasticsearch.search.aggregations.metrics.percentiles.hdr.InternalHDRPercentileRanks in project elasticsearch by elastic.
the class InternalHDRPercentilesRanksTests method assertReduced.
@Override
protected void assertReduced(InternalHDRPercentileRanks reduced, List<InternalHDRPercentileRanks> inputs) {
// it is hard to check the values due to the inaccuracy of the algorithm
long totalCount = 0;
for (InternalHDRPercentileRanks ranks : inputs) {
totalCount += ranks.state.getTotalCount();
}
assertEquals(totalCount, reduced.state.getTotalCount());
}
use of org.elasticsearch.search.aggregations.metrics.percentiles.hdr.InternalHDRPercentileRanks in project elasticsearch by elastic.
the class InternalHDRPercentilesRanksTests method createTestInstance.
@Override
protected InternalHDRPercentileRanks createTestInstance(String name, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
double[] cdfValues = new double[] { 0.5 };
int numberOfSignificantValueDigits = 3;
DoubleHistogram state = new DoubleHistogram(numberOfSignificantValueDigits);
int numValues = randomInt(100);
for (int i = 0; i < numValues; ++i) {
state.recordValue(randomDouble());
}
boolean keyed = false;
DocValueFormat format = DocValueFormat.RAW;
return new InternalHDRPercentileRanks(name, cdfValues, state, keyed, format, pipelineAggregators, metaData);
}
Aggregations