subprojects/parseq-batching/src/main/java/com/linkedin/parseq/batching/BatchAggregationTimeMetric.java
public synchronized <T> T harvest(Function<Histogram, T> consumer) {
    initializeRecorder();
    _recycle = _recorder.getIntervalHistogram(_recycle);
    return consumer.apply(_recycle);
  }
public synchronized <T> T harvest(Function<Histogram, T> consumer) {
    initializeRecorder();
    _recycle = _recorder.getIntervalHistogram(_recycle);
    return consumer.apply(_recycle);
  }
Allows consuming histogram and returning a result.
Histogram passed to the consumer includes stable, consistent view
of all values accumulated since last harvest.
This method is thread safe.
@param consumer consumer for a harvested histogram
@param <T> return type of a passed in function
@return a result of a passed in function