gyfora commented on code in PR #542:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/542#discussion_r1123261513


##########
flink-kubernetes-operator-autoscaler/src/main/java/org/apache/flink/kubernetes/operator/autoscaler/metrics/ScalingMetrics.java:
##########
@@ -156,6 +156,8 @@ public static void computeLagMetrics(
         var pendingRecords = flinkMetrics.get(FlinkMetric.PENDING_RECORDS);
         if (pendingRecords != null) {
             scalingMetrics.put(ScalingMetric.LAG, pendingRecords.getSum());
+        } else {
+            scalingMetrics.put(ScalingMetric.LAG, 0.);

Review Comment:
   Wouldn't this logic affect sources that do not report the pending records 
metric at all ?
   Those currently would go through a different codepath in: 
https://github.com/apache/flink-kubernetes-operator/blob/main/flink-kubernetes-operator-autoscaler/src/main/java/org/apache/flink/kubernetes/operator/autoscaler/metrics/ScalingMetrics.java#L111
   



-- 
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]

Reply via email to