Yunyung commented on code in PR #19068: URL: https://github.com/apache/kafka/pull/19068#discussion_r2029114746
########## clients/clients-integration-tests/src/test/java/org/apache/kafka/server/quota/CustomQuotaCallbackTest.java: ########## @@ -121,4 +165,17 @@ public void configure(Map<String, ?> configs) { } } + + public static class MonitorableCustomQuotaCallback extends CustomQuotaCallback implements Monitorable { + + private static final String METRIC_NAME = "monitorable-custom-quot-callback-name"; + private static final String METRIC_DESCRIPTION = "monitorable-custom-quot-callback-description"; Review Comment: quot -> quota ########## clients/clients-integration-tests/src/test/java/org/apache/kafka/server/quota/CustomQuotaCallbackTest.java: ########## @@ -121,4 +165,17 @@ public void configure(Map<String, ?> configs) { } } + + public static class MonitorableCustomQuotaCallback extends CustomQuotaCallback implements Monitorable { + + private static final String METRIC_NAME = "monitorable-custom-quot-callback-name"; + private static final String METRIC_DESCRIPTION = "monitorable-custom-quot-callback-description"; + + @Override + public void withPluginMetrics(PluginMetrics metrics) { + MetricName metricName = metrics.metricName(METRIC_NAME, METRIC_DESCRIPTION, Map.of()); + metrics.addMetric(metricName, (Gauge<Integer>) (config, now) -> 1); + } + Review Comment: nit: remove extra line ########## clients/clients-integration-tests/src/test/java/org/apache/kafka/server/quota/CustomQuotaCallbackTest.java: ########## @@ -69,10 +70,42 @@ public void testCustomQuotaCallbackWithControllerServer() throws InterruptedExce && CustomQuotaCallback.COUNTERS.values().stream().allMatch(counter -> counter.get() > 0), "The CustomQuotaCallback not triggered in all controllers. " ); - + + } + } + + + @ClusterTest( Review Comment: It looks like we have two methods intended to do exactly the same thing but with slightly different API: - expectedTags private static Map<String, String> expectedTags(Map<String, String> extraTags) #19050: private static Map<String, String> expectedTags(String config, String clazz, Map<String, String> extraTags) - assertMetrics private void assertMetrics(Metrics metrics, Map<String, String> expectedTags) #19050: private void assertMetrics(Metrics metrics, int expected, Map<String, String> expectedTags) Should we align them? -- 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