sumitagrawl commented on code in PR #7426:
URL: https://github.com/apache/ozone/pull/7426#discussion_r1856230875


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/SCMBlockDeletingService.java:
##########
@@ -202,12 +206,17 @@ public EmptyTaskResult call() throws Exception {
               }
             }
           }
+          long totalTime = Time.monotonicNow() - startTime;
           LOG.info("Totally added {} blocks to be deleted for"
                   + " {} datanodes / {} totalnodes, task elapsed time: {}ms",
               transactions.getBlocksDeleted(),
               transactions.getDatanodeTransactionMap().size(),
               included.size(),
-              Time.monotonicNow() - startTime);
+              totalTime);
+          metrics.setStartTimeOfLastIteration(startTime);
+          metrics.setDurationOfLastIteration(totalTime);
+          metrics.setNumBlockDeletionCommandSentInLastIteration(commandsSent);

Review Comment:
   its not useful to capture LastIteration metrics, as chart can be prepared 
with existing metrics itself. This metrics is not required.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/SCMDeletedBlockTransactionStatusManager.java:
##########
@@ -524,7 +527,12 @@ public void commitTransactions(
     }
     try {
       deletedBlockLogStateManager.removeTransactionsFromDB(txIDsToBeDeleted);
-      metrics.incrBlockDeletionTransactionCompleted(txIDsToBeDeleted.size());
+      int numTransactionsCompleted = txIDsToBeDeleted.size();
+      metrics.incrBlockDeletionTransactionCompleted(numTransactionsCompleted);

Review Comment:
   These metrics are not required, total can be derived from sucess+failure, 
and last iteration additional metrics not required.



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