gyfora commented on code in PR #751:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/751#discussion_r1450008701
##########
flink-autoscaler/src/test/java/org/apache/flink/autoscaler/RestApiMetricsCollectorTest.java:
##########
@@ -122,6 +126,56 @@ CompletableFuture<P> sendRequest(
assertEquals(pendingRecordsMetric.getSum(), 200);
}
+ @Test
+ @Timeout(60)
+ public void testJmMetricCollection() throws Exception {
+ try (MiniCluster miniCluster =
+ new MiniCluster(
+ new MiniClusterConfiguration.Builder()
+ .setNumTaskManagers(1)
+ .setNumSlotsPerTaskManager(3)
+ .build())) {
+ miniCluster.start();
+ var client =
+ new RestClusterClient<>(
+ new Configuration(),
+ "cluster",
+ (c, e) ->
+ new StandaloneClientHAServices(
+
miniCluster.getRestAddress().get().toString()));
+ do {
+ var collector = new RestApiMetricsCollector<>();
+ Map<FlinkMetric, Metric> flinkMetricMetricMap =
+ collector.queryJmMetrics(
+ client,
+ Map.of(
+ "numRegisteredTaskManagers",
FlinkMetric.NUM_TASK_MANAGERS,
+ "taskSlotsTotal",
FlinkMetric.NUM_TASK_SLOTS_TOTAL,
+ "taskSlotsAvailable",
+
FlinkMetric.NUM_TASK_SLOTS_AVAILABLE));
+ try {
+ System.out.println(flinkMetricMetricMap);
Review Comment:
remove sys out
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]