From 4ec67f612ef87e6aba7f0fb1a359ddeee00814bc Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Fri, 1 Feb 2013 16:29:58 -0800 Subject: [PATCH] Merger: Emit indexer/segment/bytes once per segment. No longer emit indexer/segment/count. --- .../merger/coordinator/exec/TaskConsumer.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/exec/TaskConsumer.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/exec/TaskConsumer.java index 2a21d67ef35..af4d2b478f9 100644 --- a/merger/src/main/java/com/metamx/druid/merger/coordinator/exec/TaskConsumer.java +++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/exec/TaskConsumer.java @@ -230,23 +230,17 @@ public class TaskConsumer implements Runnable // Emit event and log, if the task is done if (statusFromRunner.isComplete()) { - int segmentBytes = 0; - for (DataSegment segment : statusFromRunner.getSegments()) { - segmentBytes += segment.getSize(); - } - - int segmentNukedBytes = 0; - for (DataSegment segment : statusFromRunner.getSegmentsNuked()) { - segmentNukedBytes += segment.getSize(); - } - builder.setUser3(statusFromRunner.getStatusCode().toString()); + for (DataSegment segment : statusFromRunner.getSegments()) { + emitter.emit(builder.build("indexer/segment/bytes", segment.getSize())); + } + + for (DataSegment segmentNuked : statusFromRunner.getSegmentsNuked()) { + emitter.emit(builder.build("indexer/segmentNuked/bytes", segmentNuked.getSize())); + } + emitter.emit(builder.build("indexer/time/run/millis", statusFromRunner.getDuration())); - emitter.emit(builder.build("indexer/segment/count", statusFromRunner.getSegments().size())); - emitter.emit(builder.build("indexer/segment/bytes", segmentBytes)); - emitter.emit(builder.build("indexer/segmentNuked/count", statusFromRunner.getSegmentsNuked().size())); - emitter.emit(builder.build("indexer/segmentNuked/bytes", segmentNukedBytes)); if (statusFromRunner.isFailure()) { log.makeAlert("Failed to index")