You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/01/04 02:09:30 UTC
[GitHub] [druid] FrankChen021 commented on a change in pull request #12111: add a new query laning metrics to visualize lane assignment
FrankChen021 commented on a change in pull request #12111:
URL: https://github.com/apache/druid/pull/12111#discussion_r777788353
##########
File path: server/src/main/java/org/apache/druid/server/QuerySchedulerProvider.java
##########
@@ -23,27 +23,28 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.google.inject.Inject;
import com.google.inject.Provider;
+import org.apache.druid.java.util.emitter.service.ServiceEmitter;
import org.apache.druid.server.initialization.ServerConfig;
public class QuerySchedulerProvider extends QuerySchedulerConfig implements Provider<QueryScheduler>
{
private final ServerConfig serverConfig;
-
+ private ServiceEmitter emitter;
Review comment:
```suggestion
private final ServiceEmitter emitter;
```
##########
File path: server/src/main/java/org/apache/druid/server/QueryScheduler.java
##########
@@ -137,6 +170,12 @@ public void registerQueryFuture(Query<?> query, ListenableFuture<?> future)
Optional<Integer> priority = prioritizationStrategy.computePriority(queryPlus, segments);
query = priority.map(query::withPriority).orElse(query);
Optional<String> lane = laningStrategy.computeLane(queryPlus.withQuery(query), segments);
+ log.info("[%s] lane assigned to [%s] query with [%,d] priority", lane.orElse("default"), query.getType(), priority.orElse(new Integer(0)));
+ final ServiceMetricEvent.Builder builderUsr = ServiceMetricEvent.builder().setFeed("metrics")
+ .setDimension("lane", lane.orElse("default"))
+ .setDimension("dataSource", query.getDataSource().getTableNames())
+ .setDimension("type", query.getType());
+ emitter.emit(builderUsr.build("query/priority", priority.orElse(new Integer(0))));
Review comment:
```suggestion
emitter.emit(builderUsr.build("query/priority", priority.orElse(0)));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org