Interface IntervalHistogramProvider<T extends EncodableHistogram>
-
- All Known Implementing Classes:
DoubleRecorder,Recorder,SingleWriterDoubleRecorder,SingleWriterRecorder
public interface IntervalHistogramProvider<T extends EncodableHistogram>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TgetIntervalHistogram()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.TgetIntervalHistogram(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.TgetIntervalHistogram(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.voidgetIntervalHistogramInto(T targetHistogram)Place a copy of the value counts accumulated since accumulated (since the last interval histogram was taken) intotargetHistogram.
-
-
-
Method Detail
-
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 thangetIntervalHistogram()andgetIntervalHistogramInto(). The providedhistogramToRecyclemust be either be null or an interval histogram returned by a previous call togetIntervalHistogram(histogramToRecycle)orgetIntervalHistogram().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 thangetIntervalHistogram()andgetIntervalHistogramInto(). The providedhistogramToRecyclemust be either be null or an interval histogram returned by a previous call togetIntervalHistogram(histogramToRecycle)orgetIntervalHistogram().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 ofIntervalHistogramProvider. If false, will allow recycling histograms previously returned by other instances ofIntervalHistogramProvider.- 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) intotargetHistogram.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
-
-