Junguk, Normally we register metrics by task level which Stephen also explained.
Worker metrics are initialized from SystemBolt which is not exposed for users, so you can only pass class name for that. Since you can't handle these metrics its type is likely a gauge, which shows stats for specific point, not accumulative things like counter. You can refer SystemBolt to how to implement gauge style metrics. Hope this helps. Thanks, Jungtaek Lim (HeartSaVioR) 2016년 8월 5일 (금) 오후 11:07, Stephen Powis <[email protected]>님이 작성: > Basically in your bolts prepare() method you'd want to do something like > the following: > > // Create new counter metric to count how many XYZ > counterMetric = new CountMetric(); > topologyContext.registerMetric("my_count_metric", counterMetric, 60); > > where 60 is how often the metric is published, in seconds. > > > And then later within your bolt when you want to increment the count you'd > just do: > > counterMetric.incrBy(1); > > > Where 1 is however many you want to increment the metric by. > > On Fri, Aug 5, 2016 at 10:01 AM, Junguk Cho <[email protected]> wrote: > >> Hi, >> >> Is there an example to show how to use worker level metric? >> There is a document ( >> http://storm.apache.org/releases/2.0.0-SNAPSHOT/Metrics.html), but I am >> not clear how to use it. >> >> Thanks, >> Junguk >> > >
