How to monitor the size of Bolt's pending queues?

℡╲_俬逩灬. 提交于 2019-12-21 02:59:29

问题


My topology has a bottleneck or two. The capacity metric in the Storm UI is useful for identifying these, but I'd be much more interested in the size of Bolt's queues.

My understanding is that each bolt has two queues, one for tuples pending to be executed, and another for tuple pending to be emitted. Is it possible to monitor the size of these queues?

I found some stuff online about adding an ITaskHook implementation to Bolts, but it's not remotely clear how I can use this to monitor queue size. Can the methods in ITaskHook be used for to monitor this?


回答1:


You should be able to see the length of the queues for the components of your topology using the metrics mechanism. An easy way of doing is to add conf.registerMetricsConsumer(LoggingMetricsConsumer.class) to the config of your topology.

Here is an example of what I get for one of my components

4:fetch __sendqueue {write_pos=12122, read_pos=12122, capacity=1024, population=0} 4:fetch __receive {write_pos=8588, read_pos=8587, capacity=1024, population=1}



来源:https://stackoverflow.com/questions/34162410/how-to-monitor-the-size-of-bolts-pending-queues

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!