zentol commented on code in PR #19943:
URL: https://github.com/apache/flink/pull/19943#discussion_r897663259


##########
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/metrics/DeploymentStateTimeMetrics.java:
##########
@@ -75,12 +78,25 @@ public DeploymentStateTimeMetrics(
         this.clock = clock;
 
         if (semantic == JobType.BATCH) {
-            deploymentStartPredicate = completedDeployments -> 
completedDeployments == 0;
-            deploymentEndPredicate = completedDeployments -> 
completedDeployments > 0;
+            // If the job type is batch:
+            // Deployment is started iff there is atleast one task in 
deploying state and no task
+            // is either
+            // initializing or running.
+            // Deployment is completed iff any task is in either initializing 
or deploying state
+            deploymentStartPredicate =
+                    deploymentPair ->
+                            deploymentPair.getLeft() == 0 && 
deploymentPair.getRight() == 0;

Review Comment:
   Note that this comment is irrelevant if we generalize things a bit.



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