Skip to content

Commit

Permalink
Fix nginx metrics tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprodan committed May 9, 2019
1 parent 8d0b54e commit 2ff695e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/metrics/nginx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func Test_NginxSuccessRateQueryRender(t *testing.T) {
t.Fatal(err)
}

expected := `sum(rate(nginx_ingress_controller_requests{kubernetes_namespace="nginx",ingress="podinfo",status!~"5.*"}[1m])) / sum(rate(nginx_ingress_controller_requests{kubernetes_namespace="nginx",ingress="podinfo"}[1m])) * 100`
expected := `sum(rate(nginx_ingress_controller_requests{namespace="nginx",ingress="podinfo",status!~"5.*"}[1m])) / sum(rate(nginx_ingress_controller_requests{namespace="nginx",ingress="podinfo"}[1m])) * 100`

if query != expected {
t.Errorf("\nGot %s \nWanted %s", query, expected)
Expand All @@ -43,7 +43,7 @@ func Test_NginxRequestDurationQueryRender(t *testing.T) {
t.Fatal(err)
}

expected := `sum(rate(nginx_ingress_controller_ingress_upstream_latency_seconds_sum{kubernetes_namespace="nginx",ingress="podinfo"}[1m])) /sum(rate(nginx_ingress_controller_ingress_upstream_latency_seconds_count{kubernetes_namespace="nginx",ingress="podinfo"}[1m])) * 1000`
expected := `sum(rate(nginx_ingress_controller_ingress_upstream_latency_seconds_sum{namespace="nginx",ingress="podinfo"}[1m])) /sum(rate(nginx_ingress_controller_ingress_upstream_latency_seconds_count{namespace="nginx",ingress="podinfo"}[1m])) * 1000`

if query != expected {
t.Errorf("\nGot %s \nWanted %s", query, expected)
Expand Down

0 comments on commit 2ff695e

Please sign in to comment.