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類中。感謝在這個問題上的任何幫助。