I saw this question on rate Do I understand Prometheus's rate vs increase functions correctly?
second counter_value increase calculated by hand(call it ICH from now)
1 1 1
2 3 2
3 6 3
4 7 1
5 10 3
6 14 4
7 17 3
8 21 4
9 25 4
10 30 5
I didn't understand the result of
rate(counter[2s]): will get the average from the increment in 2 sec and distribute it among the seconds
So in the first 2 second we got an increment of total 3 which means the average is 1.5/sec. final result:
second result
1 1,5
2 1,5
3 2
4 2
5 3,5
6 3,5
7 3,5
8 3,5
9 4,5
10 4,5
and
rate(counter[5s]): will get the average from the increment in 5 sec and distribute it among the seconds
The same as for [2s] but we calculate the average from total increment of 5sec. final result:
second result
1 2
2 2
3 2
4 2
5 2
6 4
7 4
8 4
9 4
Could you explain me please the logic ?