Source:
public boolean doMonitor(ServiceEmitter emitter) { emitter.emit(new ServiceMetricEvent.Builder().build("segment/max", serverConfig.getMaxSize())); final CountingMap<String> pendingDeleteSizes = new CountingMap<String>(); for (DataSegment segment : zkCoordinator.getPendingDeleteSnapshot()) { pendingDeleteSizes.add(segment.getDataSource(), segment.getSize()); } for (Map.Entry<String, Long> entry : pendingDeleteSizes.entrySet()) { final String dataSource = entry.getKey(); final long pendingDeleteSize = entry.getValue(); emitter.emit( new ServiceMetricEvent.Builder() .setDimension(DruidMetrics.DATASOURCE, dataSource) .setDimension("tier", serverConfig.getTier()) .setDimension("priority", String.valueOf(serverConfig.getPriority())) .build("segment/deleting", pendingDeleteSize) ); } for (Map.Entry<String, Long> entry : serverManager.getDataSourceSizes().entrySet()) { String dataSource = entry.getKey(); long used = entry.getValue(); final ServiceMetricEvent.Builder builder = new ServiceMetricEvent.Builder().setDimension(DruidMetrics.DATASOURCE, dataSource) .setDimension("tier", serverConfig.getTier()) .setDimension("priority", String.valueOf(serverConfig.getPriority())); emitter.emit(builder.build("segment/used", used)); final double usedPercent = serverConfig.getMaxSize() == 0 ? 0 : used / (double) serverConfig.getMaxSize(); emitter.emit(builder.build("segment/usedPercent", usedPercent)); } for (Map.Entry<String, Long> entry : serverManager.getDataSourceCounts().entrySet()) { String dataSource = entry.getKey(); long count = entry.getValue(); final ServiceMetricEvent.Builder builder = new ServiceMetricEvent.Builder().setDimension(DruidMetrics.DATASOURCE, dataSource) .setDimension("tier", serverConfig.getTier()) .setDimension( "priority", String.valueOf(serverConfig.getPriority()) ); emitter.emit(builder.build("segment/count", count)); } return true; }

Target:
public boolean doMonitor(ServiceEmitter emitter) { emitter.emit(new ServiceMetricEvent.Builder().build("segment/max", serverConfig.getMaxSize())); final CountingMap<String> pendingDeleteSizes = new CountingMap<String>(); for (DataSegment segment : zkCoordinator.getPendingDeleteSnapshot()) { pendingDeleteSizes.add(segment.getDataSource(), segment.getSize()); } for (Map.Entry<String, Long> entry : pendingDeleteSizes.entrySet()) { final String dataSource = entry.getKey(); final long pendingDeleteSize = entry.getValue(); emitter.emit( new ServiceMetricEvent.Builder() .setDimension(DruidMetrics.DATASOURCE, dataSource) .setDimension("tier", serverConfig.getTier()) .setDimension("priority", String.valueOf(serverConfig.getPriority())) .build("segment/pendingDelete", pendingDeleteSize) ); } for (Map.Entry<String, Long> entry : serverManager.getDataSourceSizes().entrySet()) { String dataSource = entry.getKey(); long used = entry.getValue(); final ServiceMetricEvent.Builder builder = new ServiceMetricEvent.Builder().setDimension(DruidMetrics.DATASOURCE, dataSource) .setDimension("tier", serverConfig.getTier()) .setDimension("priority", String.valueOf(serverConfig.getPriority())); emitter.emit(builder.build("segment/used", used)); final double usedPercent = serverConfig.getMaxSize() == 0 ? 0 : used / (double) serverConfig.getMaxSize(); emitter.emit(builder.build("segment/usedPercent", usedPercent)); } for (Map.Entry<String, Long> entry : serverManager.getDataSourceCounts().entrySet()) { String dataSource = entry.getKey(); long count = entry.getValue(); final ServiceMetricEvent.Builder builder = new ServiceMetricEvent.Builder().setDimension(DruidMetrics.DATASOURCE, dataSource) .setDimension("tier", serverConfig.getTier()) .setDimension( "priority", String.valueOf(serverConfig.getPriority()) ); emitter.emit(builder.build("segment/count", count)); } return true; }