/** * Construct an auto-resizing histogram with a lowest discernible value of 1 and an auto-adjusting * highestTrackableValue. Can auto-resize up to track values up to (Long.MAX_VALUE / 2). * * @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 Histogram(final int numberOfSignificantValueDigits) { this(1, 2, numberOfSignificantValueDigits); setAutoResize(true); }
@Override public synchronized void setAutoResize(boolean autoResize) { super.setAutoResize(autoResize); }
/** * (From the Constructor of Histogram) * Construct a Histogram given the Lowest and Highest values to be tracked and a number of significant * decimal digits. Providing a lowestDiscernibleValue is useful is situations where the units used * for the histogram's values are much smaller that the minimal accuracy required. E.g. when tracking * time values stated in nanosecond units, where the minimal accuracy required is a microsecond, the * proper value for lowestDiscernibleValue would be 1000. * * @param lowestDiscernibleValue The lowest value that can be discerned (distinguished from 0) by the * histogram. Must be a positive integer that is {@literal >=} 1. May be * internally rounded down to nearest power of 2 * (if null 1 is used). * @param highestTrackableValue The highest value to be tracked by the histogram. Must be a positive * integer that is {@literal >=} (2 * lowestDiscernibleValue). * (if null 2 * lowestDiscernibleValue is used and auto-resize is enabled) * @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 HistogramMetric(Long lowestDiscernibleValue, Long highestTrackableValue, final int numberOfSignificantValueDigits) { boolean autoResize = false; if (lowestDiscernibleValue == null) lowestDiscernibleValue = 1L; if (highestTrackableValue == null) { highestTrackableValue = 2 * lowestDiscernibleValue; autoResize = true; } _histo = new Histogram(lowestDiscernibleValue, highestTrackableValue, numberOfSignificantValueDigits); if (autoResize) _histo.setAutoResize(true); }
((Histogram) intervalHistogram).copy(); accumulatedRegularHistogram.reset(); accumulatedRegularHistogram.setAutoResize(true);
@EnsuresNonNull("histogram") private void convertValuesToHistogram() { // tracking nanoseconds, but only at microsecond precision (to save histogram space) histogram = new Histogram(1000, 2000, HISTOGRAM_SIGNIFICANT_DIGITS); histogram.setAutoResize(true); for (int i = 0; i < size; i++) { histogram.recordValue(values[i]); } values = new long[0]; }
public LocalInternalHistogram( final long highestTrackableValue, final int numberOfSignificantValueDigits) { super(highestTrackableValue, numberOfSignificantValueDigits); super.setAutoResize(true); }
/** * Construct an auto-resizing histogram with a lowest discernible value of 1 and an auto-adjusting * highestTrackableValue. Can auto-resize up to track values up to (Long.MAX_VALUE / 2). * * @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 Histogram(final int numberOfSignificantValueDigits) { this(1, 2, numberOfSignificantValueDigits); setAutoResize(true); }
public LocalInternalHistogram( final long lowestDiscernibleValue, final long highestTrackableValue, final int numberOfSignificantValueDigits) { super(lowestDiscernibleValue, highestTrackableValue, numberOfSignificantValueDigits); super.setAutoResize(true); } }
@Override public synchronized void setAutoResize(boolean autoResize) { super.setAutoResize(autoResize); }
public LocalInternalHistogram(final int numberOfSignificantValueDigits) { super(numberOfSignificantValueDigits); super.setAutoResize(true); }
public IntervalBucket(Histogram aggregateHistogram, long lowestDiscernibleValue, long highestTrackableValue, int numberOfSignificantDigits, Boolean autoResize) { this.aggregateHistogram = aggregateHistogram; this.intervalHistogram = new Histogram(lowestDiscernibleValue, highestTrackableValue, numberOfSignificantDigits); if (autoResize) { this.intervalHistogram.setAutoResize(true); } this.state = IntervalState.EMPTY; }
public IntervalBucket(Histogram aggregateHistogram, long lowestDiscernibleValue, long highestTrackableValue, int numberOfSignificantDigits, Boolean autoResize) { this.aggregateHistogram = aggregateHistogram; this.intervalHistogram = new Histogram(lowestDiscernibleValue, highestTrackableValue, numberOfSignificantDigits); if (autoResize) { this.intervalHistogram.setAutoResize(true); } this.state = IntervalState.EMPTY; }
public LocalInternalHistogram(final AbstractHistogram source) { super(source); source.setAutoResize(true); super.setAutoResize(true); }
private SlidingWindowHistogram(Builder builder) { this.numberOfIntervals = builder.numberOfIntervals; this.intervalDurationMillis = builder.intervalDurationMillis; this.clock = builder.clock; this.aggregateHistogram = new Histogram(builder.lowestDiscernibleValue, builder.highestTrackableValue, builder.numberOfSignificantDigits); if (builder.autoResize) { this.aggregateHistogram.setAutoResize(true); } this.window = new IntervalBucket[this.numberOfIntervals]; for (int i = 0; i < this.numberOfIntervals; i++) { this.window[i] = new IntervalBucket(this.aggregateHistogram, builder.lowestDiscernibleValue, builder.highestTrackableValue, builder.numberOfSignificantDigits, builder.autoResize); } this.lastUpdateTime = currentTimeMillis(); }
private SlidingWindowHistogram(Builder builder) { this.numberOfIntervals = builder.numberOfIntervals; this.intervalDurationMillis = builder.intervalDurationMillis; this.clock = builder.clock; this.aggregateHistogram = new Histogram(builder.lowestDiscernibleValue, builder.highestTrackableValue, builder.numberOfSignificantDigits); if (builder.autoResize) { this.aggregateHistogram.setAutoResize(true); } this.window = new IntervalBucket[this.numberOfIntervals]; for (int i = 0; i < this.numberOfIntervals; i++) { this.window[i] = new IntervalBucket(this.aggregateHistogram, builder.lowestDiscernibleValue, builder.highestTrackableValue, builder.numberOfSignificantDigits, builder.autoResize); } this.lastUpdateTime = currentTimeMillis(); }
accumulatedRegularHistogram = ((Histogram) intervalHistogram).copy(); accumulatedRegularHistogram.reset(); accumulatedRegularHistogram.setAutoResize(true);
((Histogram) intervalHistogram).copy(); accumulatedRegularHistogram.reset(); accumulatedRegularHistogram.setAutoResize(true);
private HdrHistogramServoTimer(String label) { histogram.setAutoResize(true); min = new HdrHistogramMinGauge(MonitorConfig.builder(label + "_min").build(), histogram); max = new HdrHistogramMaxGauge(MonitorConfig.builder(label + "_max").build(), histogram); p50 = new HdrHistogramGauge(MonitorConfig.builder(label + "_p50").build(), histogram, 50); p90 = new HdrHistogramGauge(MonitorConfig.builder(label + "_p90").build(), histogram, 90); p99 = new HdrHistogramGauge(MonitorConfig.builder(label + "_p99").build(), histogram, 99); p99_9 = new HdrHistogramGauge(MonitorConfig.builder(label + "_p99_9").build(), histogram, 99.9); p99_99 = new HdrHistogramGauge(MonitorConfig.builder(label + "_p99_99").build(), histogram, 99.99); }
private HdrHistogramServoTimer(String label, List<Tag> tags) { histogram.setAutoResize(true); min = new HdrHistogramMinGauge(MonitorConfig.builder(label + "_min").withTags(tags).build(), histogram); max = new HdrHistogramMaxGauge(MonitorConfig.builder(label + "_max").withTags(tags).build(), histogram); p50 = new HdrHistogramGauge(MonitorConfig.builder(label + "_p50").withTags(tags).build(), histogram, 50); p90 = new HdrHistogramGauge(MonitorConfig.builder(label + "_p90").withTags(tags).build(), histogram, 90); p99 = new HdrHistogramGauge(MonitorConfig.builder(label + "_p99").withTags(tags).build(), histogram, 99); p99_9 = new HdrHistogramGauge(MonitorConfig.builder(label + "_p99_9").withTags(tags).build(), histogram, 99.9); p99_99 = new HdrHistogramGauge(MonitorConfig.builder(label + "_p99_99").withTags(tags).build(), histogram, 99.99); }