ivandika3 commented on code in PR #8001:
URL: https://github.com/apache/ozone/pull/8001#discussion_r1982442688
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java:
##########
@@ -392,6 +392,8 @@ private class DiskBalancerTask implements BackgroundTask {
@Override
public BackgroundTaskResult call() {
+ //start time
+ long startTime = System.currentTimeMillis();
Review Comment:
As mentioned in https://issues.apache.org/jira/browse/HDDS-12060, it's
better to use `Time.monotonicNow` for duration calculation.
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java:
##########
@@ -446,6 +448,10 @@ public BackgroundTaskResult call() {
}
oldContainer.getContainerData().getVolume()
.decrementUsedSpace(containerSize);
+
+ // Stop timing
+ long endTime = System.currentTimeMillis();
+ metrics.getMoveSuccessTime().add(endTime - startTime);
Review Comment:
Better to put these `endTime` and duration calculation in the `finally`
block to prevent duplication.
--
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]