Skip to content

Commit

Permalink
Adds test for long sum calc
Browse files Browse the repository at this point in the history
  • Loading branch information
possibull committed Feb 10, 2025
1 parent b5cd8af commit aaf555f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions prettifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ func TestPrettifySuccess(t *testing.T) {
sum(rate(node_cpu_seconds_total{mode!="idle"}[5m]) keep_metric_names)
) keep_metric_names`)

another(`(sum(rate({"3process_cpu_seconds_total", instance="foo",job="bar"}[5m] offset 1h @ start())) by (x) / on(x) group_right(y) prefix "x" sum(rate(node_cpu_seconds_total{mode!="idle"}[5m]) keep_metric_names)) keep_metric_names`,
`(
sum(
rate(
{"3process_cpu_seconds_total", instance="foo",job="bar"}[5m] offset 1h @ start()
)
) by(x)
/ on(x) group_right(y) prefix "x"
sum(rate(node_cpu_seconds_total{mode!="idle"}[5m]) keep_metric_names)
) keep_metric_names`)
another(`process_cpu_seconds_total{aaaaaaaaaaaaaaaaaa="bbbbbb"} offset 5m + (rate(xxxxxxxxxxxxxxxx{yyyyyyyy="aaaaaaa"}) keep_metric_names)`,
`(process_cpu_seconds_total{aaaaaaaaaaaaaaaaaa="bbbbbb"} offset 5m)
+
Expand Down

0 comments on commit aaf555f

Please sign in to comment.