mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmselect/promql: add deriv_fast
function for calculating fast derivative
`deriv_fast` calculates derivative based on the first and the last point on the interval instead of calculating linear regression based on all the data points on the interval. Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/73
This commit is contained in:
parent
5b47c00910
commit
d261fa2885
2 changed files with 2 additions and 0 deletions
|
@ -20,6 +20,7 @@ var rollupFuncs = map[string]newRollupFunc{
|
|||
"changes": newRollupFuncOneArg(rollupChanges),
|
||||
"delta": newRollupFuncOneArg(rollupDelta),
|
||||
"deriv": newRollupFuncOneArg(rollupDerivSlow),
|
||||
"deriv_fast": newRollupFuncOneArg(rollupDerivFast),
|
||||
"holt_winters": newRollupHoltWinters,
|
||||
"idelta": newRollupFuncOneArg(rollupIdelta),
|
||||
"increase": newRollupFuncOneArg(rollupDelta), // + rollupFuncsRemoveCounterResets
|
||||
|
|
|
@ -193,6 +193,7 @@ func TestRollupNewRollupFuncSuccess(t *testing.T) {
|
|||
f("changes", 10)
|
||||
f("delta", -89)
|
||||
f("deriv", -266.85860231406065)
|
||||
f("deriv_fast", -712)
|
||||
f("idelta", 0)
|
||||
f("increase", 275)
|
||||
f("irate", 0)
|
||||
|
|
Loading…
Reference in a new issue