lianetm commented on code in PR #20565:
URL: https://github.com/apache/kafka/pull/20565#discussion_r2380264135
##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/metrics/ConsumerRebalanceMetricsManagerTest.java:
##########
Review Comment:
now that we have multiple tests, probably best not to reuse this metrics
registry between them (could lead to failures or false positives I expect, with
metrics added in one test passing into another one?). Maybe a BeforeEach
setting the metrics obj?
##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/metrics/ConsumerRebalanceMetricsManagerTest.java:
##########
@@ -60,4 +62,239 @@ public void testAssignedPartitionCountMetric() {
subscriptionState.assignFromSubscribed(Set.of(new
TopicPartition("topic", 0)));
assertEquals(1.0d,
metrics.metric(consumerRebalanceMetricsManager.assignedPartitionsCount).metricValue());
}
+
+ @Test
+ public void testRebalanceTimingMetrics() {
+ SubscriptionState subscriptionState = new
SubscriptionState(mock(LogContext.class), AutoOffsetResetStrategy.EARLIEST);
+ ConsumerRebalanceMetricsManager metricsManager = new
ConsumerRebalanceMetricsManager(metrics, subscriptionState);
Review Comment:
this seems needed in all tests, maybe better in a single BeforeEach along
with the metrics obj?
--
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]