apoorvmittal10 commented on code in PR #19045: URL: https://github.com/apache/kafka/pull/19045#discussion_r1974546851
########## core/src/main/java/kafka/server/share/SharePartition.java: ########## @@ -1326,6 +1355,42 @@ int leaderEpoch() { return leaderEpoch; } + // Visible for testing + void recordFetchLockRatioMetric(long acquiredTime) { + // Update the total fetch lock acquired time. + double fetchLockToTotalTime; + if (acquiredTime + timeSinceLastLockAcquisitionMs == 0) { + // If the total time is 0 then the ratio is 1 i.e. the fetch lock was acquired for the complete time. + fetchLockToTotalTime = 1; Review Comment: Done. ########## core/src/main/java/kafka/server/share/SharePartition.java: ########## @@ -1326,6 +1355,42 @@ int leaderEpoch() { return leaderEpoch; } + // Visible for testing + void recordFetchLockRatioMetric(long acquiredTime) { Review Comment: Done. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org