use of com.alibaba.jstorm.common.metric.codahale.JAverageReservoir in project jstorm by alibaba.
the class MetricUtils method metricSnapshot2Histogram.
public static Histogram metricSnapshot2Histogram(MetricSnapshot snapshot) {
Histogram histogram;
if (metricAccurateCal) {
histogram = new Histogram(new ExponentiallyDecayingReservoir());
byte[] points = snapshot.get_points();
int len = snapshot.get_pointSize();
updateHistogramPoints(histogram, points, len);
} else {
histogram = new Histogram(new JAverageReservoir());
JAverageSnapshot averageSnapshot = (JAverageSnapshot) histogram.getSnapshot();
averageSnapshot.setMetricSnapshot(snapshot.deepCopy());
}
return histogram;
}
Aggregations