-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the number of merge buffers used for druid emitter
Signed-off-by: TessaIO <ahmedgrati1999@gmail.com>
- Loading branch information
Showing
7 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,4 +61,10 @@ public long getPendingRequests() | |
{ | ||
return 0; | ||
} | ||
|
||
@Override | ||
public int getUsedBufferCount() | ||
{ | ||
return 0; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
processing/src/main/java/org/apache/druid/query/MetricsEmittingMergingBlockingPool.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.apache.druid.query; | ||
|
||
import com.google.common.base.Supplier; | ||
import org.apache.druid.collections.DefaultBlockingPool; | ||
import org.apache.druid.java.util.emitter.service.ServiceEmitter; | ||
import org.apache.druid.java.util.emitter.service.ServiceMetricEvent; | ||
|
||
public class MetricsEmittingMergingBlockingPool<T> extends DefaultBlockingPool<T> | ||
implements ExecutorServiceMonitor.MetricEmitter{ | ||
|
||
public MetricsEmittingMergingBlockingPool( | ||
Supplier<T> generator, | ||
int limit, | ||
ExecutorServiceMonitor executorServiceMonitor | ||
) { | ||
super(generator, limit); | ||
executorServiceMonitor.add(this); | ||
} | ||
|
||
@Override | ||
public void emitMetrics(ServiceEmitter emitter, ServiceMetricEvent.Builder metricBuilder) | ||
{ | ||
emitter.emit(metricBuilder.build("query/merge/buffersUsed", getUsedBufferCount())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters