0
我试图从here浓汤阿帕奇风暴监控指标
配置浓汤风暴拓扑监控没有在网站上给出明显的例子或使用,需要在哪些参数和在哪里添加此代码一些澄清在上面的网站上给出
MonitorClient mclient = MonitorClient.forConfig(conf);
// There are multiple metric groups, each with multiple metrics.
// Components have names and multiple instances, each of which has an integer ID
mclient.declare(metricGroup,metric,task_id,component_id);
mclient.increment(metricGroup,metric, 1L , task_id);
TaskHook.registerTo(config);
现在我们需要为MetricGroup,metric,task_id和component_id提供哪些值?如果需要从每个Spout和Bolt找到它,我们该怎么做?这个代码应该放在哪里,在提交拓扑结构之前,还是在拓扑构建器中,或者在open/prepare方法或其他地方的单个Spout/Bolt类中。感谢在这个问题上的任何帮助。