You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ivanyu (via GitHub)" <gi...@apache.org> on 2023/02/23 20:19:02 UTC

[GitHub] [kafka] ivanyu commented on a diff in pull request #13067: KAFKA-14524: Rewrite KafkaMetricsGroup in Java

ivanyu commented on code in PR #13067:
URL: https://github.com/apache/kafka/pull/13067#discussion_r1116205167


##########
core/src/main/scala/kafka/log/LogSegment.scala:
##########
@@ -689,6 +689,7 @@ object LogSegment {
   }
 }
 
-object LogFlushStats extends KafkaMetricsGroup {
-  val logFlushTimer: Timer = newTimer("LogFlushRateAndTimeMs", TimeUnit.MILLISECONDS, TimeUnit.SECONDS)
+object LogFlushStats {
+  private val metricsGroup = new KafkaMetricsGroup(this.getClass)

Review Comment:
   Since it's an object without the class, `classOf` won't work. I replaced with `LogFlushStats.getClass` here and in other similar places you mentioned.



##########
core/src/main/scala/kafka/log/LogSegment.scala:
##########
@@ -689,6 +689,7 @@ object LogSegment {
   }
 }
 
-object LogFlushStats extends KafkaMetricsGroup {
-  val logFlushTimer: Timer = newTimer("LogFlushRateAndTimeMs", TimeUnit.MILLISECONDS, TimeUnit.SECONDS)
+object LogFlushStats {
+  private val metricsGroup = new KafkaMetricsGroup(this.getClass)

Review Comment:
   Since it's an object without the class, `classOf` won't work. I replaced with `LogFlushStats.getClass` here and in other similar places you mentioned. Makes sense?



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