@Override public long getMin() { final long minValue = copy.getMinValue(); return minValue == Long.MAX_VALUE ? 0 : minValue; }
public long getCompleted() { return histo.getTotalCount(); }
private Histogram getIntervalHistogramAndAccumulate() { Histogram intervalHistogram = histogram.getIntervalHistogram(); // add this to the total time histogram. if (totalHistogram == null) { totalHistogram = intervalHistogram; } else { totalHistogram.add(intervalHistogram); } return intervalHistogram; }
public void recordValue(long val) { _histo.recordValue(val); }
@Override public Histogram call(Histogram initialDistribution, Histogram distributionToAdd) { initialDistribution.add(distributionToAdd); return initialDistribution; } };
@Override void incrementCountAtIndex(final int index) { long criticalValue = wrp.writerCriticalSectionEnter(); try { activeCounts.incrementAndGet( normalizeIndex(index, activeCounts.getNormalizingIndexOffset(), activeCounts.length())); } finally { wrp.writerCriticalSectionExit(criticalValue); } }
@Override void addToCountAtIndex(final int index, final long value) { long criticalValue = wrp.writerCriticalSectionEnter(); try { activeCounts.addAndGet( normalizeIndex(index, activeCounts.getNormalizingIndexOffset(), activeCounts.length()), value); } finally { wrp.writerCriticalSectionExit(criticalValue); } }
@Override synchronized void fillBufferFromCountsArray(final ByteBuffer buffer) { try { wrp.readerLock(); super.fillBufferFromCountsArray(buffer); } finally { wrp.readerUnlock(); } }
public HdrHistogram(final long highestTrackableValue, final int numberOfSignificantValueDigits) { this(new AtomicHistogram(highestTrackableValue, numberOfSignificantValueDigits)); }
/** * Get the lowest recorded non-zero value level in the histogram * * @return the lowest recorded non-zero value level in the histogram */ public double getMinNonZeroValue() { return integerValuesHistogram.getMinNonZeroValue() * getIntegerToDoubleValueConversionRatio(); }
/** * Get the highest recorded value level in the histogram * * @return the Max value recorded in the histogram */ public double getMaxValue() { return integerValuesHistogram.getMaxValue() * getIntegerToDoubleValueConversionRatio(); }
@Override public long getMax() { return copy.getMaxValue(); }
/** * @param histogram The histogram this iterator will operate on * @param valueUnitsPerBucket The size (in value units) of each bucket iteration. */ public DoubleLinearIterator(final DoubleHistogram histogram, final double valueUnitsPerBucket) { this.histogram = histogram; integerLinearIterator = new LinearIterator( histogram.integerValuesHistogram, (long) (valueUnitsPerBucket * histogram.getDoubleToIntegerValueConversionRatio()) ); iterationValue = new DoubleHistogramIterationValue(integerLinearIterator.currentIterationValue); }
@Override public double getValue(double quantile) { return copy.getValueAtPercentile(quantile * 100); }
private void reset(final AbstractHistogram histogram, final long valueUnitsInFirstBucket, final double logBase) { super.resetIterator(histogram); this.logBase = logBase; this.valueUnitsInFirstBucket = valueUnitsInFirstBucket; nextValueReportingLevel = valueUnitsInFirstBucket; this.currentStepHighestValueReportingLevel = ((long) nextValueReportingLevel) - 1; this.currentStepLowestValueReportingLevel = histogram.lowestEquivalentValue(currentStepHighestValueReportingLevel); }
@Override public long getCount() { return hdrHistogram.getTotalCount(); }
/** * Reset iterator for re-use in a fresh iteration over the same histogram data set. * @param valueUnitsInFirstBucket the size (in value units) of the first value bucket step * @param logBase the multiplier by which the bucket size is expanded in each iteration step. */ public void reset(final double valueUnitsInFirstBucket, final double logBase) { integerLogarithmicIterator.reset( (long) (valueUnitsInFirstBucket * histogram.getDoubleToIntegerValueConversionRatio()), logBase ); }
/** * @param histogram The histogram this iterator will operate on */ public DoubleRecordedValuesIterator(final DoubleHistogram histogram) { this.histogram = histogram; integerRecordedValuesIterator = new RecordedValuesIterator(histogram.integerValuesHistogram); iterationValue = new DoubleHistogramIterationValue(integerRecordedValuesIterator.currentIterationValue); }
/** * Get the count of recorded values at a specific value (to within the histogram resolution at the value level). * * @param value The value for which to provide the recorded count * @return The total count of values recorded in the histogram within the value range that is * {@literal >=} lowestEquivalentValue(<i>value</i>) and {@literal <=} highestEquivalentValue(<i>value</i>) */ public long getCountAtValue(final double value) throws ArrayIndexOutOfBoundsException { return integerValuesHistogram.getCountAtValue((long)(value * getDoubleToIntegerValueConversionRatio())); }