Jackie-Jiang commented on a change in pull request #6549:
URL: https://github.com/apache/incubator-pinot/pull/6549#discussion_r573393642



##########
File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java
##########
@@ -478,4 +489,34 @@ public void cleanUpTask() {
   public Scheduler getScheduler() {
     return _scheduledExecutorService;
   }
+
+  public synchronized void reportMetrics(String taskType) {
+    Map<String, TaskState> taskStates = 
_helixTaskResourceManager.getTaskStates(taskType);
+    Map<TaskState, Integer> taskStateToCountMap = new HashMap<>();
+    for (String taskName : taskStates.keySet()) {
+      TaskState taskState = taskStates.get(taskName);
+      if (!taskStateToCountMap.containsKey(taskState)) {
+        taskStateToCountMap.put(taskState, 0);
+      }
+      taskStateToCountMap.put(taskState, taskStateToCountMap.get(taskState) + 
1);
+    }
+    // Reset all the status to 0
+    for (TaskState taskState : _taskStateToCountMap.keySet()) {

Review comment:
       I see, make sense




----------------------------------------------------------------
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.

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