Kafka - Monitoring and Operations
Consider this snippet monitoring Kafka broker metrics in Java:
double bytesIn = jmxClient.getAttribute("kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec");
double bytesOut = jmxClient.getAttribute("kafka.server:type=BrokerTopicMetrics,name=BytesOutPerSec");
if (bytesIn > bytesOut) {
System.out.println("More incoming data");
} else {
System.out.println("More outgoing data");
}What is the likely bug in this code?
