app/vmselect/promql: fix outilersk calculations

This commit is contained in:
Aliaksandr Valialkin 2020-05-19 14:44:45 +03:00
parent 5e4d08ac22
commit 37068064dd
2 changed files with 4 additions and 1 deletions

View File

@ -648,6 +648,9 @@ func aggrFuncOutliersK(afa *aggrFuncArg) ([]*timeseries, error) {
})
// Return only up to k time series with the highest variation.
for i := range variations {
tss[i] = variations[i].ts
}
for i, k := range ks {
fillNaNsAtIdx(i, k, tss)
}

View File

@ -4221,7 +4221,7 @@ func TestExecSuccess(t *testing.T) {
t.Run(`outliersk(1)`, func(t *testing.T) {
t.Parallel()
q := `outliersk(1, (
label_set(1300, "foo", "bar"),
label_set(2000, "foo", "bar"),
label_set(time(), "baz", "sss"),
))`
r := netstorage.Result{