cmccabe commented on code in PR #14010:
URL: https://github.com/apache/kafka/pull/14010#discussion_r1267251209


##########
core/src/main/scala/kafka/server/SharedServer.scala:
##########
@@ -259,15 +262,24 @@ class SharedServer(
         raftManager = _raftManager
         _raftManager.startup()
 
+        metadataLoaderMetrics = if (brokerMetrics != null) {
+          new 
MetadataLoaderMetrics(Optional.of(KafkaYammerMetrics.defaultRegistry()),
+            elapsedNs => brokerMetrics.updateBatchProcessingTime(elapsedNs),
+            batchSize => brokerMetrics.updateBatchSize(batchSize),
+            brokerMetrics.lastAppliedImageProvenance)
+        } else {
+          new 
MetadataLoaderMetrics(Optional.of(KafkaYammerMetrics.defaultRegistry()),
+            _ => {},
+            _ => {},
+            new AtomicReference[MetadataProvenance](MetadataProvenance.EMPTY))

Review Comment:
   There are a few broker-specific metrics hanging out in 
`BrokerServerMetrics.scala` and this is a way to connect 
`MetadataLoaderMetrics` to that class. So that the metadata loader only needs 
to interact with `MetadataLoaderMetrics` and not the broker-specific code.
   
   Long-term, we probably want to move all the loader metrics into 
`MetadataLoaderMetrics`, and make them all accessible on the controller as well 
as broker. But that's out of scope for this change (and would need a KIP anyway)



-- 
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-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to