umustafi commented on a change in pull request #3336:
URL: https://github.com/apache/gobblin/pull/3336#discussion_r677023743



##########
File path: 
gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowExecutionResourceLocalHandler.java
##########
@@ -199,4 +206,22 @@ public static FlowExecution 
convertFlowStatus(org.apache.gobblin.service.monitor
   private static long 
getFlowStartTime(org.apache.gobblin.service.monitoring.FlowStatus flowStatus) {
     return flowStatus.getFlowExecutionId();
   }
+
+  /**
+   * Estimate the time left to complete the copy based on the following 
formula -
+   * timeLeft = (100/completionPercentage) * timeElapsed
+   */
+  public static long estimateCopyTimeLeft(Long currentTime, Long startTime, 
int completionPercentage) {
+    if (completionPercentage == 0) {
+      return 0;
+    }
+
+    Instant current = Instant.ofEpochMilli(currentTime);
+    Instant start = Instant.ofEpochMilli(startTime);
+    Long timeBetween = Duration.between(current, start).toMillis();
+    Long timeElapsed = currentTime - startTime;
+    log.info("mylogs: timeBetween is " + timeBetween + " and elapsed is " + 
timeElapsed);

Review comment:
       will remove this log statement




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