首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Gumbo Apache风暴监测指标

Gumbo Apache风暴监测指标
EN

Stack Overflow用户
提问于 2016-03-24 23:19:14
回答 1查看 129关注 0票数 0

我正在尝试配置Gumbo以用于这里的风暴拓扑监视。

站点上没有明确的示例或用法,需要对参数以及在上面的站点上添加此代码的位置进行一些澄清。

代码语言:javascript
复制
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、度量、task_id和component_id提供哪些值?如果需要从每个喷口和螺栓上找到它,我们怎么做呢?在哪里放置这些代码,是在提交拓扑之前在拓扑生成器中,还是在open/ class方法下的单个Spout/Bolt类中,还是在其他地方。感谢在这个问题上的任何帮助。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-03-28 01:25:36

我尝试了几个选项,下面是对我起作用的配置,组名可以是任何东西,度量名称是从一个组件到另一个组件的流的名称,taskid可以是任何唯一的任务号,

代码语言:javascript
复制
conf.put("gumbo.server.kind", "local");
conf.put("gumbo.local.port", 8086); //Any port it must be same in the html file
conf.put("gumbo.start", System.currentTimeMillis());  // should be the same for all calls
conf.put("gumbo.bucketSize", 1000L);
conf.put("gumbo.enabled", true);
conf.put("gumbo.http.host", "hostname");
conf.put("gumbo.http.port", 8086);//Any port it must be same in the html file
conf.put("gumbo.http.app", "gumbo");
conf.put("gumbo.enabled", true);
conf.put("gumbo.server.key", topology_id);

MonitorClient mclient = MonitorClient.connect(conf);

GumboTaskHook.registerTo(conf);
    mclient.declare("Backlog",RTConstants.MATCH_LEFT_STREAM,3,RTConstants.TRANSFORM_LEFT_BOLT);       
    mclient.increment("Backlog",RTConstants.MATCH_LEFT_STREAM, 1L , 3);

    mclient.declare("Backlog",RTConstants.MATCH_RIGHT_STREAM,4,RTConstants.TRANSFORM_RIGHT_BOLT);       
    mclient.increment("Backlog",RTConstants.MATCH_RIGHT_STREAM, 1L , 4);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36211601

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档