Interface IntervalHistogramProvider<T extends EncodableHistogram>

All Known Implementing Classes:
DoubleRecorder, Recorder, SingleWriterDoubleRecorder, SingleWriterRecorder

public interface IntervalHistogramProvider<T extends EncodableHistogram>
  • Method Summary

    Modifier and Type
    Method
    Description
    Get a new instance of an interval histogram, which will include a stable, consistent view of all value counts accumulated since the last interval histogram was taken.
    getIntervalHistogram(T histogramToRecycle)
    Get an interval histogram, which will include a stable, consistent view of all value counts accumulated since the last interval histogram was taken.
    getIntervalHistogram(T histogramToRecycle, boolean enforceContainingInstance)
    Get an interval histogram, which will include a stable, consistent view of all value counts accumulated since the last interval histogram was taken.
    void
    getIntervalHistogramInto(T targetHistogram)
    Place a copy of the value counts accumulated since accumulated (since the last interval histogram was taken) into targetHistogram.
  • Method Details

    • getIntervalHistogram

      T getIntervalHistogram()
      Get a new instance of an interval histogram, which will include a stable, consistent view of all value counts accumulated since the last interval histogram was taken.

      Calling this will reset the value counts, and start accumulating value counts for the next interval.

      Returns:
      a histogram containing the value counts accumulated since the last interval histogram was taken.
    • getIntervalHistogram

      T getIntervalHistogram(T histogramToRecycle)
      Get an interval histogram, which will include a stable, consistent view of all value counts accumulated since the last interval histogram was taken.

      getIntervalHistogram(histogramToRecycle) accepts a previously returned interval histogram that can be recycled internally to avoid allocation and content copying operations, and is therefore significantly more efficient for repeated use than getIntervalHistogram() and getIntervalHistogramInto(). The provided histogramToRecycle must be either be null or an interval histogram returned by a previous call to getIntervalHistogram(histogramToRecycle) or getIntervalHistogram().

      NOTE: The caller is responsible for not recycling the same returned interval histogram more than once. If the same interval histogram instance is recycled more than once, behavior is undefined.

      Calling getIntervalHistogram(histogramToRecycle) will reset the value counts, and start accumulating value counts for the next interval

      Parameters:
      histogramToRecycle - a previously returned interval histogram that may be recycled to avoid allocation and copy operations.
      Returns:
      a histogram containing the value counts accumulated since the last interval histogram was taken.
    • getIntervalHistogram

      T getIntervalHistogram(T histogramToRecycle, boolean enforceContainingInstance)
      Get an interval histogram, which will include a stable, consistent view of all value counts accumulated since the last interval histogram was taken.

      getIntervalHistogram(histogramToRecycle) accepts a previously returned interval histogram that can be recycled internally to avoid allocation and content copying operations, and is therefore significantly more efficient for repeated use than getIntervalHistogram() and getIntervalHistogramInto(). The provided histogramToRecycle must be either be null or an interval histogram returned by a previous call to getIntervalHistogram(histogramToRecycle) or getIntervalHistogram().

      NOTE: The caller is responsible for not recycling the same returned interval histogram more than once. If the same interval histogram instance is recycled more than once, behavior is undefined.

      Calling getIntervalHistogram(histogramToRecycle) will reset the value counts, and start accumulating value counts for the next interval

      Parameters:
      histogramToRecycle - a previously returned interval histogram that may be recycled to avoid allocation and copy operations.
      enforceContainingInstance - if true, will only allow recycling of histograms previously returned from this instance of IntervalHistogramProvider. If false, will allow recycling histograms previously returned by other instances of IntervalHistogramProvider.
      Returns:
      a histogram containing the value counts accumulated since the last interval histogram was taken.
    • getIntervalHistogramInto

      void getIntervalHistogramInto(T targetHistogram)
      Place a copy of the value counts accumulated since accumulated (since the last interval histogram was taken) into targetHistogram.

      Calling getIntervalHistogramInto() will reset the value counts, and start accumulating value counts for the next interval.

      Parameters:
      targetHistogram - the histogram into which the interval histogram's data should be copied