ashishkumar50 commented on code in PR #8592:
URL: https://github.com/apache/ozone/pull/8592#discussion_r2135259784


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMBlockProtocolServer.java:
##########
@@ -276,14 +276,21 @@ public List<DeleteBlockGroupResult> deleteKeyBlocks(
     ScmBlockLocationProtocolProtos.DeleteScmBlockResult.Result resultCode;
     Exception e = null;
     long startNanos = Time.monotonicNowNanos();
+    long totalBlocks = 0;
+    for (BlockGroup bg : keyBlocksInfoList) {
+      totalBlocks += bg.getBlockIDList().size();
+    }
     try {
       scm.getScmBlockManager().deleteBlocks(keyBlocksInfoList);
-      perfMetrics.updateDeleteKeySuccessStats(startNanos);
+      perfMetrics.updateDeleteKeyBlocksInKeyDeleteCycle(totalBlocks);
+      perfMetrics.updateDeleteKeySuccessStats(keyBlocksInfoList.size(), 
startNanos);
       resultCode = ScmBlockLocationProtocolProtos.
           DeleteScmBlockResult.Result.success;
+      LOG.info("Total number of blocks ACK by SCM in this cycle: " + 
totalBlocks);

Review Comment:
   No need to have `info` log here, as already information is logged in audit 
log and metrics. If required update to `debug` log.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMBlockProtocolServer.java:
##########
@@ -267,7 +267,7 @@ public List<AllocatedBlock> allocateBlock(
   public List<DeleteBlockGroupResult> deleteKeyBlocks(
       List<BlockGroup> keyBlocksInfoList) throws IOException {
     if (LOG.isDebugEnabled()) {
-      LOG.debug("SCM is informed by OM to delete {} blocks",
+      LOG.debug("SCM is informed by OM to delete {} keys.",

Review Comment:
   Log total block count as well.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/metrics/SCMPerformanceMetrics.java:
##########
@@ -94,14 +100,22 @@ public void updateAllocateBlockFailureLatencyNs(long 
startNanos) {
     allocateBlockFailureLatencyNs.add(Time.monotonicNowNanos() - startNanos);
   }
 
-  public void updateDeleteKeySuccessStats(long startNanos) {
-    deleteKeySuccess.incr();
+  public void updateDeleteKeySuccessStats(long keys, long startNanos) {
+    deleteKeySuccess.incr(keys);
     deleteKeySuccessLatencyNs.add(Time.monotonicNowNanos() - startNanos);
   }
 
-  public void updateDeleteKeyFailureStats(long startNanos) {
-    deleteKeyFailure.incr();
+  public void updateDeleteKeyFailureStats(long keys, long startNanos) {
+    deleteKeyFailure.incr(keys);
     deleteKeyFailureLatencyNs.add(Time.monotonicNowNanos() - startNanos);
   }
+
+  public void updateDeleteKeyBlocksInKeyDeleteCycle(long keys) {

Review Comment:
   Name it with success



-- 
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: issues-unsubscr...@ozone.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to