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();
}
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);
}
}
Aggregations