You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "divijvaidya (via GitHub)" <gi...@apache.org> on 2023/05/15 15:50:49 UTC

[GitHub] [kafka] divijvaidya commented on a diff in pull request #13705: MINOR:Optimize the use of metrics in ReplicaManager and remove checks

divijvaidya commented on code in PR #13705:
URL: https://github.com/apache/kafka/pull/13705#discussion_r1194033848


##########
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala:
##########
@@ -369,9 +369,9 @@ class ReplicaManagerTest {
       // Use the second instance of metrics group that is constructed. The first instance is constructed by
       // ReplicaManager constructor > BrokerTopicStats > BrokerTopicMetrics.
       val mockMetricsGroup = mockMetricsGroupCtor.constructed.get(1)
-      verify(mockMetricsGroup, times(9)).newGauge(anyString(), any())
-      verify(mockMetricsGroup, times(3)).newMeter(anyString(), anyString(), any(classOf[TimeUnit]))
-      verify(mockMetricsGroup, times(12)).removeMetric(anyString())
+      verify(mockMetricsGroup, times(ReplicaManager.GaugeMetricNames.size)).newGauge(anyString(), any())

Review Comment:
   echo'ing a comment that David provided in https://github.com/apache/kafka/pull/13623#discussion_r1182595446, we can replace the `anyString()` with actual names to verify that the argument passed are correct.



-- 
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-unsubscribe@kafka.apache.org

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