zentol commented on a change in pull request #6702: [FLINK-10135] The
JobManager does not report the cluster-level metrics
URL: https://github.com/apache/flink/pull/6702#discussion_r223711096
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java
##########
@@ -734,6 +744,18 @@ public void requestHeartbeat(ResourceID resourceID, Void
payload) {
}
}
+ private void registerSlotAndTaskExecutorMetrics() {
+ jobManagerMetricGroup.gauge(
+ TASK_SLOTS_AVAILABLE_METRIC_NAME,
+ () -> (long) slotManager.getNumberFreeSlots());
Review comment:
yes, my concern was primarily over the long-term. This also becomes relevant
if new metrics are added, which will follow a similar pattern as existing ones
that don't worry about concurrency.
However, @tillrohrmann's solution isn't even overkill enough, as it could
result in exceptions being thrown by metrics (in case of a timeout) which
generally shouldn't happen. So we'd have to cache the previous result and
return that in case of a timeout.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services