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/04/01 19:02:42 UTC

[GitHub] [ozone] tanvipenumudy commented on a change in pull request #3180: HDDS-6435. Add read lock waiting and held time metrics

tanvipenumudy commented on a change in pull request #3180:
URL: https://github.com/apache/ozone/pull/3180#discussion_r840848172



##########
File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/lock/OzoneManagerLock.java
##########
@@ -172,7 +176,16 @@ private boolean lock(Resource resource, String resourceName,
       LOG.error(errorMessage);
       throw new RuntimeException(errorMessage);
     } else {
+      long startWaitingTimeNanos = Time.monotonicNowNanos();
+      /**
+       *  holdCount helps in metric updation only once in case of reentrant
+       *  locks.
+       */
+      int holdCount = manager.getActiveLockCount(resourceName);
       lockFn.accept(resourceName);
+      if (holdCount == 0) {
+        updateReadLockMetrics(resource, lockType, startWaitingTimeNanos);
+      }

Review comment:
       Hi @adoroszlai, please find the changes addressing the multiple readers metrics updation problem, thanks




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