The `cumulative_sum()` function can be used to sum each new point and output the current total. For the following points: cpu value=2 0 cpu value=4 10 cpu value=6 20 This would output the following points: > SELECT cumulative_sum(value) FROM cpu time value ---- ----- 0 2 10 6 20 12 As can be seen, each new point adds to the sum of the previous point and outputs the value with the same timestamp. The function can also be used with an aggregate like `derivative()`. > SELECT cumulative_sum(mean(value) FROM cpu WHERE time >= now() - 10m GROUP BY time(1m) |
||
---|---|---|
.. | ||
backup | ||
help | ||
restore | ||
run | ||
main.go |