juncevich commented on code in PR #7139:
URL: https://github.com/apache/ozone/pull/7139#discussion_r1819267025


##########
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/ContainerBalancerStatusSubcommand.java:
##########
@@ -60,12 +64,15 @@ public void execute(ScmClient scmClient) throws IOException 
{
     boolean isRunning = response.getIsRunning();
     ContainerBalancerStatusInfo balancerStatusInfo = 
response.getContainerBalancerStatusInfo();
     if (isRunning) {
+      Instant startedAtInstant = 
Instant.ofEpochSecond(balancerStatusInfo.getStartedAt());
       LocalDateTime dateTime =
-          
LocalDateTime.ofInstant(Instant.ofEpochSecond(balancerStatusInfo.getStartedAt()),
 ZoneId.systemDefault());
+          LocalDateTime.ofInstant(startedAtInstant, ZoneId.systemDefault());
       System.out.println("ContainerBalancer is Running.");
 
       if (verbose) {
-        System.out.printf("Started at: %s %s%n%n", dateTime.toLocalDate(), 
dateTime.toLocalTime());
+        System.out.printf("Started at: %s %s%n", dateTime.toLocalDate(), 
dateTime.toLocalTime());
+        Duration balancingDuration = Duration.between(startedAtInstant, 
OffsetDateTime.now());
+        System.out.printf("Balancing duration: %s%n%n", 
getPrettyDuration(balancingDuration));

Review Comment:
   I think '1h 30m' better than 'PT1H30M'.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to