slfan1989 opened a new pull request, #1346:
URL: https://github.com/apache/ratis/pull/1346

   ## What changes were proposed in this pull request?
   
   ### Problem
   The `MessageMetrics.inc()` method contains duplicate code that calls 
computeIfAbsent twice for the same key, along with an unnecessary 
`synchronized` block. 
   
   This leads to:
   - Redundant map lookups
   - Code duplication and poor readability
   - Potential performance overhead
   
   ## What is the link to the Apache JIRA
   
   RATIS-2405. Remove duplicate computeIfAbsent call in MessageMetrics.inc() 
method.
   
   ## How was this patch tested?
   
   - Test Changes
   Updated `TestGrpcMessageMetrics` to verify the counter increment behavior 
more reliably by comparing before/after values instead of relying on absolute 
counts.


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

Reply via email to