If you keep adding up the time the function has taken across all
invocations, that is also a counter. You can get the average run time over,
say, 5 minutes by tracking

rate(function_run_time_sum[5m]) / rate(function_run_time_count[5m])

Using native Prometheus clients, you get both if you use either a summary
or a histogram and .observe() each invocation time as it happens.

/MR


On Tue, Jan 12, 2021 at 6:37 AM Manish G <[email protected]>
wrote:

> Hi All,
>
> We have some flink metrics configured for our flatmap functions. We have
> basically a gauge which keeps track of total time function has taken so far
> and a counter which keeps track of number of times function has been
> invoked.
>
> We want to capture average time taken by the function in grafana panel.
> Can we use above 2 metrics for this purpose(gauge/counter) or should we
> use what is explained here
> <https://ci.apache.org/projects/flink/flink-docs-stable/ops/metrics.html#latency-tracking>
> .
>
> WIth regards
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/CAOFd6ij85%2BPs%3DsuOqpD7TPJiV3_8v%2BBA3us%3Dicm5o8t1zNh0-Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-users/CAOFd6ij85%2BPs%3DsuOqpD7TPJiV3_8v%2BBA3us%3Dicm5o8t1zNh0-Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAMV%3D_gbOECHKujOm6nUsEGAO8dUOA37aeSLGPH%2Bmp%3Dy4mgBR5w%40mail.gmail.com.

Reply via email to