[ https://issues.apache.org/jira/browse/KAFKA-5244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16011053#comment-16011053 ]
ASF GitHub Bot commented on KAFKA-5244: --------------------------------------- GitHub user ijuma opened a pull request: https://github.com/apache/kafka/pull/3059 KAFKA-5244: Refactor BrokerTopicStats and ControllerStats so that they are classes This removes the need to force object initialisation via hacks to register the relevant metrics during start-up. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ijuma/kafka kafka-5244-broker-static-stats-and-controller-stats-as-classes Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/3059.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3059 ---- commit 94340b85e4095cc8dad7ed18d9c50124d400d753 Author: Ismael Juma <ism...@juma.me.uk> Date: 2017-05-05T13:06:08Z Refactor BrokerTopicStats and ControllerStats so that they are classes This removes the need to force object initialisation via hacks to register the relevant metrics during start-up. ---- > Tests which delete singleton metrics break subsequent metrics tests > ------------------------------------------------------------------- > > Key: KAFKA-5244 > URL: https://issues.apache.org/jira/browse/KAFKA-5244 > Project: Kafka > Issue Type: Bug > Components: core > Reporter: Rajini Sivaram > Assignee: Rajini Sivaram > Fix For: 0.11.0.0 > > > Static metrics like {{BrokerTopicStats.ReplicationBytesInPerSec}} are created > in a singleton, resulting in one metric being created in a JVM. Some tests > like {{MetricsDuringTopicCreationDeletionTest}} delete all metrics from the > static metrics registry. The singleton metrics don't get recreated and > subsequent tests relying on these metrics may fail. > Singleton metrics make testing hard - we have no idea what metrics are being > tested. Not sure we want to change that though since there is a lot of code > that relies on this. But we have to fix tests to ensure that metrics are left > in a good state. -- This message was sent by Atlassian JIRA (v6.3.15#6346)