问题
I am a little unclear on when to exactly use increase and when to use sum_over_time in order to calculate a periodic collection of data in Grafana. I want to calculate the total percentage of availability of my system. Thanks.
回答1:
The "increase" function calculates how much a counter increased in the specified interval.
The "sum_over_time" function calculates the sum of all values in the specified interval.
Suppose you have the following data series in the specified interval:
5, 5, 5, 5, 6, 6, 7, 8, 8, 8
Then you would get:
increase = 8-5 = 3
sum_over_time = 5+5+5+5+6+6+7+8+8+8 = 63
If your goal is to calculate the total percentage of availability I think it's better to use the "avg_over_time" function.
来源:https://stackoverflow.com/questions/63289864/when-to-use-sum-over-time-vs-increase-promql-grafana