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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to