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/07/05 00:45:40 UTC

[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #7126: Wire TaskMetricsEmitter to controller starter

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



##########
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:
       This task will run on the controller that hashes into the task name. We should be emitting this metric from one controller only. So, either we introduce another task, or change the task to be running on one controller (that is fine too, we don't expect that there are too many task types in the clustter)




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