When to use sum_over_time vs increase Promql Grafana

白昼怎懂夜的黑 提交于 2021-01-28 20:27:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!