Skip to content

Commit

Permalink
[Bug] Fix the issue where metrics do not update upon restart. (#4148)
Browse files Browse the repository at this point in the history
Co-authored-by: yuhang2.zhang <[email protected]>
  • Loading branch information
Jam804 and yuhang2.zhang authored Dec 19, 2024
1 parent 5fd4cfd commit 13ac2c6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ class FlinkMetricWatcher(conf: MetricWatcherConfig = MetricWatcherConfig.default
future.onComplete(_.getOrElse(None) match {
case Some(metric) =>
val clusterKey = id.toClusterKey
// update current flink cluster metrics on cache
watchController.flinkMetrics.put(clusterKey, metric)
val isMetricChanged = {
val preMetric = watchController.flinkMetrics.get(clusterKey)
preMetric == null || !preMetric.equalsPayload(metric)
}
if (isMetricChanged) {
eventBus.postAsync(FlinkClusterMetricChangeEvent(id, metric))
// update current flink cluster metrics on cache
watchController.flinkMetrics.put(clusterKey, metric)
}
case _ =>
})
Expand Down

0 comments on commit 13ac2c6

Please sign in to comment.