如何监视Bolt挂起队列的大小? [英] How to monitor the size of Bolt's pending queues?

查看:76
本文介绍了如何监视Bolt挂起队列的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的拓扑有一个或两个瓶颈. Storm UI中的容量指标对于识别这些漏洞很有用,但是我对Bolt队列的大小更感兴趣.

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?

我在网上找到了一些有关将ITaskHook实现添加到Bolts的内容,但目前还不清楚如何使用它来监视队列大小. ITaskHook中的方法可以用于监视此情况吗?

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?

推荐答案

您应该能够使用

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}

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}

这篇关于如何监视Bolt挂起队列的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆