Skip to content

Commit

Permalink
improve consolidateBy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mchrome committed Jun 28, 2024
1 parent 41787f6 commit 2e3ce81
Showing 1 changed file with 112 additions and 104 deletions.
216 changes: 112 additions & 104 deletions tests/consolidateBy/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,26 @@ template = "graphite-clickhouse.conf.tpl"

[[test.input]]
name = "request_success_total.counter;app=test;project=Test;environment=TEST"
points = [{value = 1.0, time = "rnow-10"}]
points = [{value = 3.0, time = "1000"}, {value = 0.0, time = "1010"}, {value = 1.0, time = "1020"}, {value = 2.0, time = "1030"}]

[[test.input]]
name = "request_success_total.counter;app=test;project=Test;environment=TEST;t=q"
points = [{value = 1.0, time = "rnow-10"}]
points = [{value = 3.0, time = "1000"}, {value = 0.0, time = "1010"}, {value = 1.0, time = "1020"}, {value = 2.0, time = "1030"}]

[[test.input]]
name = "test;env=prod"
points = [{value = 1.0, time = "rnow-10"}]
points = [{value = 3.0, time = "1000"}, {value = 0.0, time = "1010"}, {value = 1.0, time = "1020"}, {value = 2.0, time = "1030"}]

[[test.input]]
name = "test;env=dr"
points = [{value = 1.0, time = "rnow-10"}]
points = [{value = 3.0, time = "1000"}, {value = 0.0, time = "1010"}, {value = 1.0, time = "1020"}, {value = 2.0, time = "1030"}]

# consolidateBy('max')

[[test.render_checks]]
from = "rnow-10"
until = "rnow+1"
from = "1000"
until = "1030"
max_data_points = 2
timeout = "1h"
targets = [
"seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')",
Expand All @@ -54,29 +55,30 @@ filtering_functions = [
name = "request_success_total.counter;app=test;environment=TEST;project=Test"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "max"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [3.0, 2.0]

[[test.render_checks.result]]
name = "request_success_total.counter;app=test;environment=TEST;project=Test;t=q"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "max"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [3.0, 2.0]

# consolidateBy('min')

[[test.render_checks]]
from = "rnow-10"
until = "rnow+1"
from = "1000"
until = "1030"
max_data_points = 2
timeout = "1h"
targets = [
"seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')",
Expand All @@ -89,29 +91,31 @@ filtering_functions = [
name = "request_success_total.counter;app=test;environment=TEST;project=Test"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "min"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [0.0, 1.0]

[[test.render_checks.result]]
name = "request_success_total.counter;app=test;environment=TEST;project=Test;t=q"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "min"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [0.0, 1.0]


# consolidateBy('sum')

[[test.render_checks]]
from = "rnow-10"
until = "rnow+1"
from = "1000"
until = "1030"
max_data_points = 2
timeout = "1h"
targets = [
"seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')",
Expand All @@ -124,29 +128,30 @@ filtering_functions = [
name = "request_success_total.counter;app=test;environment=TEST;project=Test"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "sum"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [3.0, 3.0]

[[test.render_checks.result]]
name = "request_success_total.counter;app=test;environment=TEST;project=Test;t=q"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "sum"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [3.0, 3.0]

# consolidateBy('avg')

[[test.render_checks]]
from = "rnow-10"
until = "rnow+1"
from = "1000"
until = "1030"
max_data_points = 2
timeout = "1h"
targets = [
"seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')",
Expand All @@ -159,29 +164,30 @@ filtering_functions = [
name = "request_success_total.counter;app=test;environment=TEST;project=Test"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "avg"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [1.5, 1.5]

[[test.render_checks.result]]
name = "request_success_total.counter;app=test;environment=TEST;project=Test;t=q"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "avg"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [1.5, 1.5]

# consolidateBy('average')

[[test.render_checks]]
from = "rnow-10"
until = "rnow+1"
from = "1000"
until = "1030"
max_data_points = 2
timeout = "1h"
targets = [
"seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')",
Expand All @@ -194,29 +200,30 @@ filtering_functions = [
name = "request_success_total.counter;app=test;environment=TEST;project=Test"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "avg"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [1.5, 1.5]

[[test.render_checks.result]]
name = "request_success_total.counter;app=test;environment=TEST;project=Test;t=q"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "avg"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [1.5, 1.5]

# consolidateBy('last')

[[test.render_checks]]
from = "rnow-10"
until = "rnow+1"
from = "1000"
until = "1030"
max_data_points = 2
timeout = "1h"
targets = [
"seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')",
Expand All @@ -229,29 +236,30 @@ filtering_functions = [
name = "request_success_total.counter;app=test;environment=TEST;project=Test"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "last"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [0.0, 2.0]

[[test.render_checks.result]]
name = "request_success_total.counter;app=test;environment=TEST;project=Test;t=q"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "last"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [0.0, 2.0]

# consolidateBy('first')

[[test.render_checks]]
from = "rnow-10"
until = "rnow+1"
from = "1000"
until = "1030"
max_data_points = 2
timeout = "1h"
targets = [
"seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')",
Expand All @@ -264,29 +272,29 @@ filtering_functions = [
name = "request_success_total.counter;app=test;environment=TEST;project=Test"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "first"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [3.0, 1.0]

[[test.render_checks.result]]
name = "request_success_total.counter;app=test;environment=TEST;project=Test;t=q"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')"
consolidation = "first"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]
start = "1000"
stop = "1040"
step = 20
req_start = "1000"
req_stop = "1040"
values = [3.0, 1.0]

# consolidateBy('invalid')

[[test.render_checks]]
from = "rnow-10"
until = "rnow+1"
from = "1000"
until = "1030"
timeout = "1h"
targets = [
"seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST')",
Expand Down

0 comments on commit 2e3ce81

Please sign in to comment.