MINOR: Remove the test for ZooKeeper metrics used by ZooKeeperClient (#18775)

Reviewers: Ismael Juma <ismael@juma.me.uk>, Ken Huang <s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
Jhen-Yung Hsu 2025-02-03 20:06:01 +08:00 committed by GitHub
parent bf05d2c914
commit 9ba2621620
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 17 deletions

View File

@ -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)

View File

@ -198,6 +198,13 @@
<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>