d4v1de commented on code in PR #20397:
URL: https://github.com/apache/kafka/pull/20397#discussion_r2496489782


##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -4121,9 +4137,19 @@ class KafkaApis(val requestChannel: RequestChannel,
         case ApiKeys.PRODUCE =>
           
brokerTopicStats.topicStats(tp.topic).produceMessageConversionsRate.mark(conversionCount)
           
brokerTopicStats.allTopicsStats.produceMessageConversionsRate.mark(conversionCount)
+          if (MetricsVerbosityController.shouldEmitPartitionMetric(
+            config, BrokerTopicMetrics.PRODUCE_MESSAGE_CONVERSIONS_PER_SEC, 
tp.topic)) {
+            val m = brokerTopicStats.partitionStats(tp.topic, tp.partition)
+            m.produceMessageConversionsRate().mark(conversionCount)

Review Comment:
   What do you think of moving the `shouldEmitPartitionMetric` invokation to 
`MeterWrapper`?
   The code here could simply invoke 
`m.produceMessageConversionsRate().mark(conversionCount)`.
   `produceMessageConversionsRate()` could either return an empty implementor 
with a no-op `mark()` method, or the actual metric.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to