Search in sources :

Example 1 with DefaultMetricsWriterContext

use of io.cdap.cdap.metrics.process.DefaultMetricsWriterContext in project cdap by caskdata.

the class MetricsWritersMetricsPublisher method initializeMetricWriters.

private void initializeMetricWriters(Map<String, MetricsWriter> metricsWriters, CConfiguration cConf) {
    for (Map.Entry<String, MetricsWriter> entry : metricsWriters.entrySet()) {
        MetricsWriter writer = entry.getValue();
        // Metrics context used by MetricsStoreMetricsWriter only, which we don't use here
        // So we can pass no-op context
        DefaultMetricsWriterContext metricsWriterContext = new DefaultMetricsWriterContext(new NoopMetricsContext(), cConf, writer.getID());
        writer.initialize(metricsWriterContext);
    }
}
Also used : MetricsWriter(io.cdap.cdap.api.metrics.MetricsWriter) DefaultMetricsWriterContext(io.cdap.cdap.metrics.process.DefaultMetricsWriterContext) NoopMetricsContext(io.cdap.cdap.api.metrics.NoopMetricsContext) Map(java.util.Map)

Aggregations

MetricsWriter (io.cdap.cdap.api.metrics.MetricsWriter)1 NoopMetricsContext (io.cdap.cdap.api.metrics.NoopMetricsContext)1 DefaultMetricsWriterContext (io.cdap.cdap.metrics.process.DefaultMetricsWriterContext)1 Map (java.util.Map)1