Search in sources :

Example 1 with JHistogram

use of com.alibaba.jstorm.common.metric.codahale.JHistogram in project jstorm by alibaba.

the class AsmHistogram method doFlush.

/**
     * flush temp histogram data to all windows & assoc metrics.
     */
protected void doFlush() {
    long[] values = unFlushed.getSnapshot().getValues();
    for (JHistogram histogram : histogramMap.values()) {
        for (long val : values) {
            histogram.update(val);
        }
    }
    if (MetricUtils.metricAccurateCal) {
        for (long val : values) {
            for (AsmMetric metric : this.assocMetrics) {
                metric.updateDirectly(val);
            }
        }
    }
    this.unFlushed = newHistogram();
}
Also used : JHistogram(com.alibaba.jstorm.common.metric.codahale.JHistogram)

Example 2 with JHistogram

use of com.alibaba.jstorm.common.metric.codahale.JHistogram in project jstorm by alibaba.

the class AsmHistogram method updateSnapshot.

@Override
protected void updateSnapshot(int window) {
    JHistogram histogram = histogramMap.get(window);
    if (histogram != null) {
        AsmSnapshot snapshot = new AsmHistogramSnapshot().setSnapshot(histogram.getSnapshot()).setTs(System.currentTimeMillis()).setMetricId(metricId);
        snapshots.put(window, snapshot);
    }
}
Also used : AsmSnapshot(com.alibaba.jstorm.common.metric.snapshot.AsmSnapshot) JHistogram(com.alibaba.jstorm.common.metric.codahale.JHistogram) AsmHistogramSnapshot(com.alibaba.jstorm.common.metric.snapshot.AsmHistogramSnapshot)

Aggregations

JHistogram (com.alibaba.jstorm.common.metric.codahale.JHistogram)2 AsmHistogramSnapshot (com.alibaba.jstorm.common.metric.snapshot.AsmHistogramSnapshot)1 AsmSnapshot (com.alibaba.jstorm.common.metric.snapshot.AsmSnapshot)1