Source:
<code>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())) <START> .build("segment/deleting", pendingDeleteSize) <END> ); } 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; }</code><technical_language>I segment/pendingDelete better, matches variable naming :)</technical_language>

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; }