简体   繁体   English

如何衡量kafka生产者每秒产生的消息数量?

[英]How to measure the number of messages produced by kafka producer per second?

I am learning Kafka for my university project, I would like to know the logging technique to monitor number of messages produced per second by Kafka producer.我正在为我的大学项目学习 Kafka,我想知道记录技术来监控 Kafka 生产者每秒产生的消息数量。

Thanks for helping.谢谢你的帮助。

There are lot of Kafka metrics that are exposed on JMX. JMX 上公开了许多 Kafka 指标。 You can check the official docs here for that.你可以在这里查看官方文档。 As you can see there, one of the Producer metrics is request-rate (the average number of requests sent per second.).正如您在那里看到的,生产者指标之一是request-rate (每秒发送的平均请求数。)。 You just need to enable JMX in the producer client JVM.您只需要在生产者客户端 JVM 中启用 JMX。 Some more helpful info can be found here and here .一些更有用的信息可以在这里这里找到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM