sahildevgon commented on code in PR #22454:
URL: https://github.com/apache/kafka/pull/22454#discussion_r3403672195
##########
core/src/main/scala/kafka/server/KafkaBroker.scala:
##########
@@ -120,5 +120,10 @@ trait KafkaBroker extends Logging {
if (linuxIoMetricsCollector.usable()) {
metricsGroup.newGauge("linux-disk-read-bytes", () =>
linuxIoMetricsCollector.readBytes())
Review Comment:
Thanks @chia7712 , I just pushed a refractor : cached fields are now
volatile and the staleness check is consolidated into a single refreshIfStale()
using double-checked locking. Each getter now does a volatile
read of lastUpdateMs plus the cached field with no monitor acquisition in
the cached path, so a single JMX scrape across all 7 gauges takes the lock at
most once per ms-window (and zero times in steady state). /proc/self/io is
still read at most once per ms thanks to the existing cache. PTAL
--
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]