storm-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Powis <>
Subject Re: Example of worker level metric?
Date Fri, 05 Aug 2016 14:07:11 GMT
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:


Where 1 is however many you want to increment the metric by.

On Fri, Aug 5, 2016 at 10:01 AM, Junguk Cho <> wrote:

> Hi,
> Is there an example to show how to use worker level metric?
> There is a document (
> Metrics.html), but I am not clear how to use it.
> Thanks,
> Junguk

View raw message