AndrewJSchofield commented on code in PR #20283: URL: https://github.com/apache/kafka/pull/20283#discussion_r2288227393
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java: ########## @@ -2270,10 +2276,14 @@ public Metrics metricsRegistry() { } @Override - public AsyncConsumerMetrics kafkaConsumerMetrics() { + public KafkaConsumerMetrics kafkaConsumerMetrics() { return kafkaConsumerMetrics; } + public AsyncConsumerMetrics asyncConsumerMetrics() { Review Comment: I don't think this needs to be public. The test is in the same package. For `kafkaConsumerMetrics()`, there is a test which accesses the metrics object from the external object via the delegate. ########## clients/src/test/java/org/apache/kafka/clients/consumer/internals/metrics/AsyncConsumerMetricsTest.java: ########## @@ -47,21 +47,6 @@ public void tearDown() { public void shouldMetricNames() { // create consumerMetrics = new AsyncConsumerMetrics(metrics); - Set<MetricName> expectedMetrics = Set.of( - metrics.metricName("last-poll-seconds-ago", CONSUMER_METRIC_GROUP), - metrics.metricName("time-between-poll-avg", CONSUMER_METRIC_GROUP), - metrics.metricName("time-between-poll-max", CONSUMER_METRIC_GROUP), - metrics.metricName("poll-idle-ratio-avg", CONSUMER_METRIC_GROUP), - metrics.metricName("commit-sync-time-ns-total", CONSUMER_METRIC_GROUP), - metrics.metricName("committed-time-ns-total", CONSUMER_METRIC_GROUP) - ); - expectedMetrics.forEach( - metricName -> assertTrue( - metrics.metrics().containsKey(metricName), - "Missing metric: " + metricName - ) - ); - Set<MetricName> expectedConsumerMetrics = Set.of( Review Comment: I suggest renaming this to `expectedMetrics`. It is specifically NOT the expected consumer metrics :) -- 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