Search in sources :

Example 1 with Builder

use of org.apache.druid.java.util.emitter.service.ServiceMetricEvent.Builder in project druid by druid-io.

the class ShuffleMonitor method doMonitor.

@Override
public boolean doMonitor(ServiceEmitter emitter) {
    if (shuffleMetrics != null) {
        final Map<String, PerDatasourceShuffleMetrics> snapshot = shuffleMetrics.snapshotAndReset();
        snapshot.forEach((supervisorTaskId, perDatasourceShuffleMetrics) -> {
            final Builder metricBuilder = ServiceMetricEvent.builder().setDimension(SUPERVISOR_TASK_ID_DIMENSION, supervisorTaskId);
            emitter.emit(metricBuilder.build(SHUFFLE_BYTES_KEY, perDatasourceShuffleMetrics.getShuffleBytes()));
            emitter.emit(metricBuilder.build(SHUFFLE_REQUESTS_KEY, perDatasourceShuffleMetrics.getShuffleRequests()));
        });
    }
    return true;
}
Also used : Builder(org.apache.druid.java.util.emitter.service.ServiceMetricEvent.Builder) PerDatasourceShuffleMetrics(org.apache.druid.indexing.worker.shuffle.ShuffleMetrics.PerDatasourceShuffleMetrics)

Aggregations

PerDatasourceShuffleMetrics (org.apache.druid.indexing.worker.shuffle.ShuffleMetrics.PerDatasourceShuffleMetrics)1 Builder (org.apache.druid.java.util.emitter.service.ServiceMetricEvent.Builder)1