Metrics for number of events in a timeframe

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Metrics for number of events in a timeframe

Manish G
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


Reply | Threaded
Open this post in threaded view
|

Re: Metrics for number of events in a timeframe

Chesnay Schepler
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
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Metrics for number of events in a timeframe

Manish G
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 <[hidden email]> 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
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Metrics for number of events in a timeframe

Chesnay Schepler
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 <[hidden email]> 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
>
>