morhidi commented on code in PR #617:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/617#discussion_r1223995845


##########
flink-kubernetes-operator-autoscaler/src/main/java/org/apache/flink/kubernetes/operator/autoscaler/JobAutoScalerImpl.java:
##########
@@ -102,10 +108,8 @@ public boolean scale(FlinkResourceContext<? extends 
AbstractFlinkResource<?, ?>>
                             resource, autoScalerInfo, ctx.getFlinkService(), 
conf);
 
             LOG.debug("Evaluating scaling metrics for {}", collectedMetrics);
-            var evaluatedMetrics = evaluator.evaluate(conf, collectedMetrics);
+            evaluatedMetrics = evaluator.evaluate(conf, collectedMetrics);
             LOG.debug("Scaling metrics evaluated: {}", evaluatedMetrics);
-            lastEvaluatedMetrics.put(resourceId, evaluatedMetrics);
-            flinkMetrics.registerScalingMetrics(() -> 
lastEvaluatedMetrics.get(resourceId));
 
             if (!collectedMetrics.isFullyCollected()) {
                 // We have done an upfront evaluation, but we are not ready 
for scaling.

Review Comment:
   We can do that, and I feel like null is a more safe choice the Double.nan. 
@mxm what do you think? Shall we keep or wipe the metrics during the metric 
window? Since the recommended parallelism is set to the current parallelism to 
me both are ok.



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