Skip to content

Commit

Permalink
MINOR: Remove the test for ZooKeeper metrics used by ZooKeeperClient (#…
Browse files Browse the repository at this point in the history
…18775)

Reviewers: Ismael Juma <[email protected]>, Ken Huang <[email protected]>, Chia-Ping Tsai <[email protected]>
  • Loading branch information
Yunyung authored Feb 3, 2025
1 parent bf05d2c commit 9ba2621
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
17 changes: 0 additions & 17 deletions core/src/test/scala/unit/kafka/metrics/MetricsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -234,23 +234,6 @@ class MetricsTest extends KafkaServerTestHarness with Logging {
})
}

/**
* Test that the metrics are created with the right name, testZooKeeperStateChangeRateMetrics
* and testZooKeeperSessionStateMetric in ZooKeeperClientTest test the metrics behaviour.
*/
@ParameterizedTest
@ValueSource(strings = Array("kraft"))
def testSessionExpireListenerMetrics(quorum: String): Unit = {
val metrics = KafkaYammerMetrics.defaultRegistry.allMetrics
val expectedNumMetrics = 0
assertEquals(expectedNumMetrics, metrics.keySet.asScala.
count(_.getMBeanName == "kafka.server:type=SessionExpireListener,name=SessionState"))
assertEquals(expectedNumMetrics, metrics.keySet.asScala.
count(_.getMBeanName == "kafka.server:type=SessionExpireListener,name=ZooKeeperExpiresPerSec"))
assertEquals(expectedNumMetrics, metrics.keySet.asScala.
count(_.getMBeanName == "kafka.server:type=SessionExpireListener,name=ZooKeeperDisconnectsPerSec"))
}

private def topicMetrics(topic: Option[String]): Set[String] = {
val metricNames = KafkaYammerMetrics.defaultRegistry.allMetrics().keySet.asScala.map(_.getMBeanName)
filterByTopicMetricRegex(metricNames, topic)
Expand Down
7 changes: 7 additions & 0 deletions docs/zk2kraft.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ <h5 class="anchor-heading">Removal metrics</h5>
<li><code>kafka.server:type=DelayedOperationPurgatory,name=PurgatorySize,delayedOperation=topic</code></li>
<li><code>kafka.server:type=DelayedOperationPurgatory,name=NumDelayedOperations,delayedOperation=ElectLeader</code></li>
<li><code>kafka.server:type=DelayedOperationPurgatory,name=NumDelayedOperations,delayedOperation=topic</code></li>
<li><code>kafka.server:type=SessionExpireListener,name=SessionState</code></li>
<li><code>kafka.server:type=SessionExpireListener,name=ZooKeeperAuthFailuresPerSec</code></li>
<li><code>kafka.server:type=SessionExpireListener,name=ZooKeeperDisconnectsPerSec</code></li>
<li><code>kafka.server:type=SessionExpireListener,name=ZooKeeperExpiresPerSec</code></li>
<li><code>kafka.server:type=SessionExpireListener,name=ZooKeeperReadOnlyConnectsPerSec</code></li>
<li><code>kafka.server:type=SessionExpireListener,name=ZooKeeperSaslAuthenticationsPerSec</code></li>
<li><code>kafka.server:type=SessionExpireListener,name=ZooKeeperSyncConnectsPerSec</code></li>
<li><code>kafka.server:type=ZooKeeperClientMetrics,name=ZooKeeperRequestLatencyMs</code></li>
</ul>
</li>
Expand Down

0 comments on commit 9ba2621

Please sign in to comment.