tanvipenumudy commented on code in PR #6321:
URL: https://github.com/apache/ozone/pull/6321#discussion_r1514015946


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyDeleteRequest.java:
##########
@@ -87,7 +89,10 @@ public OMRequest preExecute(OzoneManager ozoneManager) 
throws IOException {
     OzoneManagerProtocolProtos.KeyArgs.Builder newKeyArgs =
         
keyArgs.toBuilder().setModificationTime(Time.now()).setKeyName(keyPath);
 
+    long startNanosDeleteKeyResolveBucketAndCheckAclsLatency = 
Time.monotonicNowNanos();
     KeyArgs resolvedArgs = resolveBucketAndCheckAcls(ozoneManager, newKeyArgs);

Review Comment:
   You can wrap the 
[`MetricUtil#captureLatencyNs`](https://github.com/apache/ozone/blob/master/hadoop-hdds/common/src/main/java/org/apache/hadoop/util/MetricUtil.java)
 block directly around the `resolveBucketAndCheckAcls` call.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeysDeleteRequest.java:
##########
@@ -153,13 +159,15 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, TermIn
 
         try {
           // check Acl
+          long startNanosDeleteKeysAclCheckLatency = Time.monotonicNowNanos();
           checkKeyAcls(ozoneManager, volumeName, bucketName, keyName,
               IAccessAuthorizer.ACLType.DELETE, OzoneObj.ResourceType.KEY,
               volumeOwner);
           OzoneFileStatus fileStatus = getOzoneKeyStatus(
               ozoneManager, omMetadataManager, volumeName, bucketName, 
keyName);
           addKeyToAppropriateList(omKeyInfoList, omKeyInfo, dirList,
               fileStatus);
+          perfMetrics.setDeleteKeysAclCheckLatencyNs(Time.monotonicNowNanos() 
- startNanosDeleteKeysAclCheckLatency);

Review Comment:
   Given that we're specifically tracking the `DeleteKeysAclCheckLatency`, we 
need to ensure that we are exclusively capturing only the `checkKeyAcls` call.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeysDeleteRequest.java:
##########
@@ -121,13 +124,16 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, TermIn
             .setVolumeName(volumeName).setBucketName(bucketName);
 
     boolean deleteStatus = true;
+    long startNanos = Time.monotonicNowNanos();
     try {
+      long startNanosDeleteKeysResolveBucketLatency = Time.monotonicNowNanos();
       ResolvedBucket bucket =

Review Comment:
   Here as well, the 
[`MetricUtil#captureLatencyNs`](https://github.com/apache/ozone/blob/master/hadoop-hdds/common/src/main/java/org/apache/hadoop/util/MetricUtil.java)
 block can directly be wrapped around the `resolveBucketLink` call. This should 
make the code less verbose and more readable.



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