mcvsubbu commented on a change in pull request #7099:
URL: https://github.com/apache/incubator-pinot/pull/7099#discussion_r660849514
##########
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);
+
_minionMetrics.addValueToGlobalGauge(MinionGauge.NUMBER_OF_TASKS, 1L);
+ TaskResult result = runInternal();
Review comment:
Can you add a try/finally here?
--
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]