You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/06/29 21:16:31 UTC

[GitHub] [incubator-pinot] jackjlli commented on a change in pull request #7099: Add minion metrics of task queueing time and task numbers

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

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



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