mirror of https://github.com/apache/druid.git
Fix metrics for inserting segments (#5749)
* Fix metrics for inserting segments * Add a comment
This commit is contained in:
parent
aa23fe6386
commit
c9d645103b
|
@ -125,21 +125,20 @@ public class SegmentTransactionalInsertAction implements TaskAction<SegmentPubli
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
// Emit metrics
|
||||
final ServiceMetricEvent.Builder metricBuilder = new ServiceMetricEvent.Builder();
|
||||
IndexTaskUtils.setTaskDimensions(metricBuilder, task);
|
||||
|
||||
if (retVal.isSuccess()) {
|
||||
// Emit metrics
|
||||
final ServiceMetricEvent.Builder metricBuilder = new ServiceMetricEvent.Builder();
|
||||
IndexTaskUtils.setTaskDimensions(metricBuilder, task);
|
||||
toolbox.getEmitter().emit(metricBuilder.build("segment/txn/success", 1));
|
||||
} else {
|
||||
toolbox.getEmitter().emit(metricBuilder.build("segment/txn/failure", 1));
|
||||
}
|
||||
|
||||
if (retVal.isSuccess()) {
|
||||
toolbox.getEmitter().emit(metricBuilder.build("segment/txn/success", 1));
|
||||
} else {
|
||||
toolbox.getEmitter().emit(metricBuilder.build("segment/txn/failure", 1));
|
||||
}
|
||||
|
||||
for (DataSegment segment : retVal.getSegments()) {
|
||||
metricBuilder.setDimension(DruidMetrics.INTERVAL, segment.getInterval().toString());
|
||||
toolbox.getEmitter().emit(metricBuilder.build("segment/added/bytes", segment.getSize()));
|
||||
}
|
||||
// getSegments() should return an empty set if announceHistoricalSegments() failed
|
||||
for (DataSegment segment : retVal.getSegments()) {
|
||||
metricBuilder.setDimension(DruidMetrics.INTERVAL, segment.getInterval().toString());
|
||||
toolbox.getEmitter().emit(metricBuilder.build("segment/added/bytes", segment.getSize()));
|
||||
}
|
||||
|
||||
return retVal;
|
||||
|
|
Loading…
Reference in New Issue