From 1cecfee411f91c8f0f278fcf6b876f2b77437d63 Mon Sep 17 00:00:00 2001 From: "s.hadzic" Date: Fri, 26 May 2023 16:29:20 +0200 Subject: [PATCH 1/2] Fix numRunningJobs and numRegisteredTaskManagers metrics --- .../criteo/hadoop/garmadon/flink/GarmadonFlinkReporter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frameworks/flink/src/main/java/com/criteo/hadoop/garmadon/flink/GarmadonFlinkReporter.java b/frameworks/flink/src/main/java/com/criteo/hadoop/garmadon/flink/GarmadonFlinkReporter.java index 8a43c65e..eb701106 100644 --- a/frameworks/flink/src/main/java/com/criteo/hadoop/garmadon/flink/GarmadonFlinkReporter.java +++ b/frameworks/flink/src/main/java/com/criteo/hadoop/garmadon/flink/GarmadonFlinkReporter.java @@ -203,9 +203,9 @@ private void tryToSet(Runnable c) { private void reportJobManagerMetrics(long currentTimeMillis) { FlinkEventProtos.JobManagerEvent.Builder builder = FlinkEventProtos.JobManagerEvent.newBuilder(); - - tryToSet(() -> builder.setNumRunningJobs(((Gauge) gauges.get("numRegisteredTaskManagers")).getValue())); - tryToSet(() -> builder.setNumRegisteredTaskManagers(((Gauge) gauges.get("numRunningJobs")).getValue())); + + tryToSet(() -> builder.setNumRunningJobs(((Gauge) gauges.get("numRunningJobs")).getValue())); + tryToSet(() -> builder.setNumRegisteredTaskManagers(((Gauge) gauges.get("numRegisteredTaskManagers")).getValue())); tryToSet(() -> builder.setTaskSlotsAvailable(((Gauge) gauges.get("taskSlotsAvailable")).getValue())); tryToSet(() -> builder.setTaskSlotsTotal(((Gauge) gauges.get("taskSlotsTotal")).getValue())); From 7b8cdcaaf7b88849ab69b9cc69cf8b88f17cca21 Mon Sep 17 00:00:00 2001 From: "s.hadzic" Date: Fri, 26 May 2023 16:32:45 +0200 Subject: [PATCH 2/2] Remove extra spaces --- .../com/criteo/hadoop/garmadon/flink/GarmadonFlinkReporter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/flink/src/main/java/com/criteo/hadoop/garmadon/flink/GarmadonFlinkReporter.java b/frameworks/flink/src/main/java/com/criteo/hadoop/garmadon/flink/GarmadonFlinkReporter.java index eb701106..6e7982e7 100644 --- a/frameworks/flink/src/main/java/com/criteo/hadoop/garmadon/flink/GarmadonFlinkReporter.java +++ b/frameworks/flink/src/main/java/com/criteo/hadoop/garmadon/flink/GarmadonFlinkReporter.java @@ -203,7 +203,7 @@ private void tryToSet(Runnable c) { private void reportJobManagerMetrics(long currentTimeMillis) { FlinkEventProtos.JobManagerEvent.Builder builder = FlinkEventProtos.JobManagerEvent.newBuilder(); - + tryToSet(() -> builder.setNumRunningJobs(((Gauge) gauges.get("numRunningJobs")).getValue())); tryToSet(() -> builder.setNumRegisteredTaskManagers(((Gauge) gauges.get("numRegisteredTaskManagers")).getValue())); tryToSet(() -> builder.setTaskSlotsAvailable(((Gauge) gauges.get("taskSlotsAvailable")).getValue()));