You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/05/23 05:58:17 UTC

[GitHub] [ozone] tanvipenumudy commented on a diff in pull request #3424: HDDS-6735. Provide configuration for enabling OMLockMetrics

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


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/lock/OzoneManagerLock.java:
##########
@@ -202,6 +196,26 @@ private boolean lock(Resource resource, String resourceName,
     }
   }
 
+  private void updateLockMetrics(Resource resource, String resourceName,
+                         Consumer<String> lockFn, String lockType) {
+    long startWaitingTimeNanos = Time.monotonicNowNanos();
+    lockFn.accept(resourceName);
+
+    /**
+     *  read/write lock hold count helps in metrics updation only once in case
+     *  of reentrant locks.
+     */
+    if (lockType.equals(READ_LOCK) &&

Review Comment:
   Thank you for the suggestion, I have made the required changes to incorporate the switch case.



-- 
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-unsubscribe@ozone.apache.org

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


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