mateczagany commented on code in PR #558: URL: https://github.com/apache/flink-kubernetes-operator/pull/558#discussion_r1156270801
########## flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/AbstractFlinkService.java: ########## @@ -645,10 +641,19 @@ public Map<String, String> getClusterInfo(Configuration conf) throws Exception { dashboardConfiguration.getFlinkRevision()); } - // JobManager resource usage can be deduced from the CR - var jmParameters = - new KubernetesJobManagerParameters( - conf, new KubernetesClusterClientFactory().getClusterSpecification(conf)); + clusterInfo.putAll( + calculateClusterResourceMetrics( + conf, getTaskManagersInfo(conf).getTaskManagerInfos().size())); + + return clusterInfo; + } + + private HashMap<String, String> calculateClusterResourceMetrics( Review Comment: You're right! I've also moved the method to two separate methods in `FlinkUtils` and will add tests tomorrow if this seems okay. This will result in duplicated code, but I think it improves the code, also easier to re-use and test this way. I will add tests for the two new methods tomorrow. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org