rodesai commented on a change in pull request #11149:
URL: https://github.com/apache/kafka/pull/11149#discussion_r691775378



##########
File path: 
streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamsProducerTest.java
##########
@@ -1121,4 +1125,60 @@ public void 
shouldResetTransactionInitializedOnResetProducer() {
         verify(mockedProducer);
     }
 
+    @Test
+    public void shouldComputeTotalBlockedTime() {
+        setProducerMetrics(nonEosMockProducer, 1, 2, 3, 4, 5, 6, 7);
+
+        final double expectedTotalBlocked = 1 + 2 + 3 + 4 + 5 + 6 + 7;
+        assertThat(nonEosStreamsProducer.totalBlockedTime(), 
equalTo(expectedTotalBlocked));
+    }
+
+    @Test
+    public void shouldComputeTotalBlockedTimeAfterReset() {
+        setProducerMetrics(eosBetaMockProducer, 1, 2, 3, 4, 5, 6, 7);
+        eosBetaStreamsProducer.resetProducer();
+
+        final double expectedTotalBlocked = 1 + 2 + 3 + 4 + 5 + 6 + 7;
+        assertThat(eosBetaStreamsProducer.totalBlockedTime(), greaterThan(2 * 
expectedTotalBlocked));

Review comment:
       ah somehow I thought we couldn't use the hamcrest matchers. 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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to