mcvsubbu commented on a change in pull request #7126:
URL: https://github.com/apache/incubator-pinot/pull/7126#discussion_r665687574



##########
File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/TaskMetricsEmitter.java
##########
@@ -86,5 +96,15 @@ protected final void runTask() {
         LOGGER.error("Caught exception while getting metrics for task type 
{}", taskType, e);
       }
     }
+
+    // Emit metric to count the number of online minion instances.
+    List<String> onlineInstances = 
_pinotHelixResourceManager.getOnlineInstanceList();
+    int onlineMinionInstanceCount = 0;
+    for (String onlineInstance : onlineInstances) {
+      if 
(onlineInstance.startsWith(CommonConstants.Helix.PREFIX_OF_MINION_INSTANCE)) {
+        onlineMinionInstanceCount++;
+      }
+    }
+    
_controllerMetrics.addValueToGlobalGauge(ControllerGauge.ONLINE_MINION_INSTANCES,
 onlineMinionInstanceCount);

Review comment:
       Ah, u r right. My bad. I thought we hashed on task type. it turns out we 
hashed on task name, so this will be emitted only on one controller.




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