mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/streamaggr: add missing test cases
Signed-off-by: hagen1778 <roman@victoriametrics.com>
(cherry picked from commit 2f65956259
)
This commit is contained in:
parent
f3cbd62823
commit
c835a6351e
1 changed files with 47 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue