Search in sources :

Example 1 with JAverageReservoir

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;
}
Also used : JAverageSnapshot(com.alibaba.jstorm.common.metric.codahale.JAverageSnapshot) JAverageReservoir(com.alibaba.jstorm.common.metric.codahale.JAverageReservoir)

Aggregations

JAverageReservoir (com.alibaba.jstorm.common.metric.codahale.JAverageReservoir)1 JAverageSnapshot (com.alibaba.jstorm.common.metric.codahale.JAverageSnapshot)1