lib/streamaggr: add missing test cases

Signed-off-by: hagen1778 <roman@victoriametrics.com>
This commit is contained in:
hagen1778 2024-07-12 11:06:45 +02:00
parent 2eb1bc4f81
commit 2f65956259
No known key found for this signature in database
GPG Key ID: 3BF75F3741CA9640

View File

@ -48,6 +48,12 @@ func TestAggregatorsFailure(t *testing.T) {
- interval: 1m
`)
// Bad interval
f(`
- interval: 1foo
outputs: [total]
`)
// Invalid output
f(`
- interval: 1m
@ -65,6 +71,13 @@ func TestAggregatorsFailure(t *testing.T) {
interval: 10ms
`)
// bad dedup_interval
f(`
- interval: 1m
dedup_interval: 1foo
outputs: ["quantiles"]
`)
// interval isn't multiple of dedup_interval
f(`
- interval: 1m
@ -79,6 +92,27 @@ func TestAggregatorsFailure(t *testing.T) {
outputs: ["quantiles"]
`)
// bad staleness_interval
f(`
- interval: 1m
staleness_interval: 1foo
outputs: ["quantiles"]
`)
// staleness_interval should be > interval
f(`
- interval: 1m
staleness_interval: 30s
outputs: ["quantiles"]
`)
// staleness_interval should be multiple of interval
f(`
- interval: 1m
staleness_interval: 100s
outputs: ["quantiles"]
`)
// keep_metric_names is set for multiple inputs
f(`
- interval: 1m
@ -873,6 +907,19 @@ foo{abc="123", cde="1"} 4 10
foo:1m_by_cde_rate_sum{cde="1"} 0
`, "11")
// unique_samples output
f(`
- interval: 1m
outputs: [unique_samples]
`, `
foo 1 10
foo 2 20
foo 1 10
foo 2 20
foo 3 20
`, `foo:1m_unique_samples 3
`, "11111")
// keep_metric_names
f(`
- interval: 1m