<<Counter resets make it more complex than that; only the periods where the value is not decreasing are considered.>>
Isn't the rate function supposed to take care of resets? OR it does so only when used with an aggregator like sum(). On Sat, Sep 5, 2020 at 1:45 PM Brian Candler <[email protected]> wrote: > Not exactly. If there are no counter resets, then it's > > *(last value in time window - first value in time window) / (timestamp of > last value - timestamp of first value)* > > Consider a 5 minute window with 1 minute scrape intervals. You are likely > to have 5 values within the window, and there is 4 minutes between the > first and last. > > <--------- 5 mins --------> > | X X X X X | > <------ 4 mins -----> > > So the rate is calculated over the 4 minute period between the first and > last X. > > Counter resets make it more complex than that; only the periods where the > value is not decreasing are considered. > > On Saturday, 5 September 2020 07:56:35 UTC+1, Manish G wrote: >> >> And how about corresponding X axis value? Is it the start of the time >> window or end or middle of it or something else? >> > > The time at the *end* of the time window. That is, foo[1h] looks back 1 > hour from the instant that the query is requested for. > > -- > 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/c21f491e-ac62-4a81-90df-618941e9e709o%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/c21f491e-ac62-4a81-90df-618941e9e709o%40googlegroups.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/CAOFd6ig434yta7F6y-h%2Bs2c6P%2BCyp4Hwb%3D4r-G13vsqoZXX3pw%40mail.gmail.com.

