/** * Construct a new auto-resizing DoubleHistogram using a precision stated as a number * of significant decimal digits. * * @param numberOfSignificantValueDigits Specifies the precision to use. This is the number of significant * decimal digits to which the histogram will maintain value resolution * and separation. Must be a non-negative integer between 0 and 5. */ public DoubleHistogram(final int numberOfSignificantValueDigits) { this(2, numberOfSignificantValueDigits, Histogram.class, null); setAutoResize(true); }
@Override public synchronized void setAutoResize(boolean autoResize) { super.setAutoResize(autoResize); }
/** * Construct a new auto-resizing DoubleHistogram using a precision stated as a number * of significant decimal digits. * * The {@link org.HdrHistogram.DoubleHistogram} will use the specified AbstractHistogram subclass * for tracking internal counts (e.g. {@link org.HdrHistogram.Histogram}, * {@link org.HdrHistogram.ConcurrentHistogram}, {@link org.HdrHistogram.SynchronizedHistogram}, * {@link org.HdrHistogram.IntCountsHistogram}, {@link org.HdrHistogram.ShortCountsHistogram}). * * @param numberOfSignificantValueDigits Specifies the precision to use. This is the number of significant * decimal digits to which the histogram will maintain value resolution * and separation. Must be a non-negative integer between 0 and 5. * @param internalCountsHistogramClass The class to use for internal counts tracking */ public DoubleHistogram(final int numberOfSignificantValueDigits, final Class<? extends AbstractHistogram> internalCountsHistogramClass) { this(2, numberOfSignificantValueDigits, internalCountsHistogramClass, null); setAutoResize(true); }
new DoubleHistogram(3); accumulatedDoubleHistogram.reset(); accumulatedDoubleHistogram.setAutoResize(true);
@Override public InternalAggregation buildEmptyAggregation() { DoubleHistogram state; state = new DoubleHistogram(numberOfSignificantValueDigits); state.setAutoResize(true); return new InternalHDRPercentiles(name, keys, state, keyed, format, pipelineAggregators(), metaData()); } }
@Override public InternalAggregation buildEmptyAggregation() { DoubleHistogram state; state = new DoubleHistogram(numberOfSignificantValueDigits); state.setAutoResize(true); return new InternalHDRPercentileRanks(name, keys, state, keyed, format, pipelineAggregators(), metaData()); }
@Override public AbstractInternalHDRPercentiles doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) { DoubleHistogram merged = null; for (InternalAggregation aggregation : aggregations) { final AbstractInternalHDRPercentiles percentiles = (AbstractInternalHDRPercentiles) aggregation; if (merged == null) { merged = new DoubleHistogram(percentiles.state); merged.setAutoResize(true); } merged.add(percentiles.state); } return createReduced(getName(), keys, merged, keyed, pipelineAggregators(), getMetaData()); }
/** * Construct a new auto-resizing DoubleHistogram using a precision stated as a number * of significant decimal digits. * * @param numberOfSignificantValueDigits Specifies the precision to use. This is the number of significant * decimal digits to which the histogram will maintain value resolution * and separation. Must be a non-negative integer between 0 and 5. */ public DoubleHistogram(final int numberOfSignificantValueDigits) { this(2, numberOfSignificantValueDigits, Histogram.class, null); setAutoResize(true); }
public LocalDoubleHistogram() { super(2, 4, LocalInternalHistogram.class); super.setAutoResize(true); }
@Override public synchronized void setAutoResize(boolean autoResize) { super.setAutoResize(autoResize); }
@Override public void collect(int doc, long bucket) throws IOException { states = bigArrays.grow(states, bucket + 1); DoubleHistogram state = states.get(bucket); if (state == null) { state = new DoubleHistogram(numberOfSignificantValueDigits); // Set the histogram to autosize so it can resize itself as // the data range increases. Resize operations should be // rare as the histogram buckets are exponential (on the top // level). In the future we could expose the range as an // option on the request so the histogram can be fixed at // initialisation and doesn't need resizing. state.setAutoResize(true); states.set(bucket, state); } if (values.advanceExact(doc)) { final int valueCount = values.docValueCount(); for (int i = 0; i < valueCount; i++) { state.recordValue(values.nextValue()); } } } };
@Override public InternalAggregation buildEmptyAggregation() { DoubleHistogram state; state = new DoubleHistogram(numberOfSignificantValueDigits); state.setAutoResize(true); return new InternalHDRPercentiles(name, keys, state, keyed, format, pipelineAggregators(), metaData()); } }
@Override public InternalAggregation buildEmptyAggregation() { DoubleHistogram state; state = new DoubleHistogram(numberOfSignificantValueDigits); state.setAutoResize(true); return new InternalHDRPercentileRanks(name, keys, state, keyed, format, pipelineAggregators(), metaData()); }
@Override public InternalAggregation buildEmptyAggregation() { DoubleHistogram state; state = new DoubleHistogram(numberOfSignificantValueDigits); state.setAutoResize(true); return new InternalHDRPercentiles(name, keys, state, keyed, formatter, pipelineAggregators(), metaData()); }
@Override public InternalAggregation buildEmptyAggregation() { DoubleHistogram state; state = new DoubleHistogram(numberOfSignificantValueDigits); state.setAutoResize(true); return new InternalHDRPercentileRanks(name, keys, state, keyed, formatter, pipelineAggregators(), metaData()); }
@Override public InternalAggregation buildEmptyAggregation() { DoubleHistogram state; state = new DoubleHistogram(numberOfSignificantValueDigits); state.setAutoResize(true); return new InternalHDRPercentileRanks(name, keys, state, keyed, format, pipelineAggregators(), metaData()); }
@Override public InternalAggregation buildEmptyAggregation() { DoubleHistogram state; state = new DoubleHistogram(numberOfSignificantValueDigits); state.setAutoResize(true); return new InternalHDRPercentiles(name, keys, state, keyed, format, pipelineAggregators(), metaData()); } }
@Override public InternalAggregation buildEmptyAggregation() { DoubleHistogram state; state = new DoubleHistogram(numberOfSignificantValueDigits); state.setAutoResize(true); return new InternalHDRPercentileRanks(name, keys, state, keyed, format, pipelineAggregators(), metaData()); }
@Override public InternalAggregation buildEmptyAggregation() { DoubleHistogram state; state = new DoubleHistogram(numberOfSignificantValueDigits); state.setAutoResize(true); return new InternalHDRPercentiles(name, keys, state, keyed, format, pipelineAggregators(), metaData()); } }
@Override public AbstractInternalHDRPercentiles doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) { DoubleHistogram merged = null; for (InternalAggregation aggregation : aggregations) { final AbstractInternalHDRPercentiles percentiles = (AbstractInternalHDRPercentiles) aggregation; if (merged == null) { merged = new DoubleHistogram(percentiles.state); merged.setAutoResize(true); } merged.add(percentiles.state); } return createReduced(getName(), keys, merged, keyed, pipelineAggregators(), getMetaData()); }