You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Manish G <ma...@gmail.com> on 2020/08/04 13:04:52 UTC

Metrics for number of events in a timeframe

Hi,

Meter gives throughput while counter gives number of events since system
started. What if I have to find number of events processed in say, last 5
minutes.

Is there an inbuilt metrics for it OR do I need to do meter * timeframe?

With regards

Re: Metrics for number of events in a timeframe

Posted by Chesnay Schepler <ch...@apache.org>.
No, because Flink counters are mapped to Prometheus gauges.

On 04/08/2020 15:52, Manish G wrote:
> That documentation states:
>
> |delta| should only be used with gauges.
>
> Would that cause an issue as we are using counter.
>
> With regards
>
> On Tue, Aug 4, 2020 at 7:12 PM Chesnay Schepler <chesnay@apache.org 
> <ma...@apache.org>> wrote:
>
>     meter * timeframe (in seconds) is the simplest option, although it
>     will
>     not be that accurate due to the flattening of spikes.
>
>     You'd get the best results by using a time-series database, and
>     calculating the difference between the current count and one 5
>     minutes ago.
>     An example for Prometheus:
>     https://prometheus.io/docs/prometheus/latest/querying/functions/#delta
>     .
>
>     On 04/08/2020 15:04, Manish G wrote:
>     > Hi,
>     >
>     > Meter gives throughput while counter gives number of events since
>     > system started. What if I have to find number of events
>     processed in
>     > say, last 5 minutes.
>     >
>     > Is there an inbuilt metrics for it OR do I need to do meter *
>     timeframe?
>     >
>     > With regards
>     >
>     >
>


Re: Metrics for number of events in a timeframe

Posted by Manish G <ma...@gmail.com>.
That documentation states:

delta should only be used with gauges.

Would that cause an issue as we are using counter.

With regards

On Tue, Aug 4, 2020 at 7:12 PM Chesnay Schepler <ch...@apache.org> wrote:

> meter * timeframe (in seconds) is the simplest option, although it will
> not be that accurate due to the flattening of spikes.
>
> You'd get the best results by using a time-series database, and
> calculating the difference between the current count and one 5 minutes ago.
> An example for Prometheus:
> https://prometheus.io/docs/prometheus/latest/querying/functions/#delta .
>
> On 04/08/2020 15:04, Manish G wrote:
> > Hi,
> >
> > Meter gives throughput while counter gives number of events since
> > system started. What if I have to find number of events processed in
> > say, last 5 minutes.
> >
> > Is there an inbuilt metrics for it OR do I need to do meter * timeframe?
> >
> > With regards
> >
> >
>
>

Re: Metrics for number of events in a timeframe

Posted by Chesnay Schepler <ch...@apache.org>.
meter * timeframe (in seconds) is the simplest option, although it will 
not be that accurate due to the flattening of spikes.

You'd get the best results by using a time-series database, and 
calculating the difference between the current count and one 5 minutes ago.
An example for Prometheus: 
https://prometheus.io/docs/prometheus/latest/querying/functions/#delta .

On 04/08/2020 15:04, Manish G wrote:
> Hi,
>
> Meter gives throughput while counter gives number of events since 
> system started. What if I have to find number of events processed in 
> say, last 5 minutes.
>
> Is there an inbuilt metrics for it OR do I need to do meter * timeframe?
>
> With regards
>
>