jackjlli commented on a change in pull request #7099:
URL: https://github.com/apache/incubator-pinot/pull/7099#discussion_r660968992



##########
File path: 
pinot-minion/src/main/java/org/apache/pinot/minion/taskfactory/TaskFactoryRegistry.java
##########
@@ -67,19 +71,31 @@ public TaskFactoryRegistry(TaskExecutorFactoryRegistry 
taskExecutorFactoryRegist
             private final TaskConfig _taskConfig = context.getTaskConfig();
             private final PinotTaskExecutor _taskExecutor = 
taskExecutorFactory.create();
             private final MinionEventObserver _eventObserver = 
eventObserverFactory.create();
+            private final MinionMetrics _minionMetrics = 
MinionContext.getInstance().getMinionMetrics();
 
             @Override
             public TaskResult run() {
-              MinionMetrics minionMetrics = 
MinionContext.getInstance().getMinionMetrics();
+              HelixManager helixManager = context.getManager();
+              JobContext jobContext = TaskDriver.getJobContext(helixManager, 
context.getJobConfig().getJobId());
+              // jobContext.getStartTime() return the time in milliseconds of 
job being put into helix queue.
+              long jobInQueueTime = jobContext.getStartTime();
+              long jobDequeueTime = System.currentTimeMillis();
+              _minionMetrics.addPhaseTiming(taskType, 
MinionQueryPhase.TASK_QUEUEING, jobDequeueTime - jobInQueueTime);

Review comment:
       One more thing to note is that `MinionQueryPhase.TASK_EXECUTION` logs 
time in **nanoseconds** while this one logs time in **milliseconds**. The time 
granularity needs to be unified.




-- 
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-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to