Merger: Emit indexer/segment/bytes once per segment. No longer emit indexer/segment/count.

This commit is contained in:
Gian Merlino 2013-02-01 16:29:58 -08:00
parent 9e88197845
commit 4ec67f612e
1 changed files with 8 additions and 14 deletions

View File

@ -230,23 +230,17 @@ public class TaskConsumer implements Runnable
// Emit event and log, if the task is done // Emit event and log, if the task is done
if (statusFromRunner.isComplete()) { 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()); 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/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()) { if (statusFromRunner.isFailure()) {
log.makeAlert("Failed to index") log.makeAlert("Failed to index")