anjy7 commented on code in PR #22669:
URL: https://github.com/apache/kafka/pull/22669#discussion_r3484006323


##########
raft/src/testFixtures/java/org/apache/kafka/raft/RaftClientTestContext.java:
##########
@@ -1061,6 +1076,18 @@ List<RaftRequest.Outbound> 
assertSentBeginQuorumEpochRequest(int epoch, Set<Inte
         return requests;
     }
 
+    /**
+     * Removes and counts all responses the client has sent to inbound 
requests. Used by the JMH
+     * raft benchmarks to measure {@code rpcResponsesSent} per operation. 
Unlike the mock work
+     * counters, responses are collected here (not in a mock), so draining the 
collection both
+     * yields the per-operation delta and bounds its growth across a long 
benchmark iteration.
+     */
+    int drainAllSentResponses() {
+        int count = sentResponses.size();
+        sentResponses.clear();
+        return count;
+    }
+

Review Comment:
   refer - https://github.com/apache/kafka/pull/22669#discussion_r3484005056



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