apoorvmittal10 commented on code in PR #19045: URL: https://github.com/apache/kafka/pull/19045#discussion_r1975320265
########## core/src/main/java/kafka/server/share/SharePartition.java: ########## @@ -1326,6 +1355,56 @@ int leaderEpoch() { return leaderEpoch; } + /** + * Records the fetch lock ratio metric. The metric is the ratio of the time the fetch lock was + * acquired to the total time since the last lock acquisition. The total time is calculated by + * adding the time since the last lock acquisition to the time the fetch lock was acquired. + * + * @param acquiredTime The time duration the fetch lock was acquired. + */ + // Visible for testing + void recordFetchLockRatioMetric(long acquiredTime) { Review Comment: I have updated the code with variable names as `durationMs`. Also I changed the way idle time is calculated by taking an explicit variable, where the code becomes easy to understand. Please let me know your thoughts. -- 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