You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert.Regexp(t, "request_duration_seconds.*le=\"0.005\"", rec.Body.String(), "duration should have time bucket (like, 0.005s)")
52
-
assert.NotRegexp(t, "request_duration_seconds.*le=\"512000\"", rec.Body.String(), "duration should NOT have a size bucket (like, 512K)")
53
-
assert.Regexp(t, "response_size_bytes.*le=\"512000\"", rec.Body.String(), "response size should have a 512K (size) bucket")
54
-
assert.NotRegexp(t, "response_size_bytes.*le=\"0.005\"", rec.Body.String(), "response size should NOT have time bucket (like, 0.005s)")
55
-
assert.Regexp(t, "request_size_bytes.*le=\"512000\"", rec.Body.String(), "request size should have a 512K (size) bucket")
56
-
assert.NotRegexp(t, "request_size_bytes.*le=\"0.005\"", rec.Body.String(), "request should NOT have time bucket (like, 0.005s)")
51
+
52
+
body:=rec.Body.String()
53
+
assert.Contains(t, body, `echo_request_duration_seconds_bucket{code="404",host="example.com",method="GET",url="/ping",le="0.005"}`, "duration should have time bucket (like, 0.005s)")
54
+
assert.NotContains(t, body, `echo_request_duration_seconds_bucket{code="404",host="example.com",method="GET",url="/ping",le="512000"}`, "duration should NOT have a size bucket (like, 512K)")
55
+
assert.Contains(t, body, `echo_request_size_bytes_bucket{code="404",host="example.com",method="GET",url="/ping",le="1024"}`, "request size should have a 1024k (size) bucket")
56
+
assert.NotContains(t, body, `echo_request_size_bytes_bucket{code="404",host="example.com",method="GET",url="/ping",le="0.005"}`, "request size should NOT have time bucket (like, 0.005s)")
57
+
assert.Contains(t, body, `echo_response_size_bytes_bucket{code="404",host="example.com",method="GET",url="/ping",le="1024"}`, "response size should have a 1024k (size) bucket")
58
+
assert.NotContains(t, body, `echo_response_size_bytes_bucket{code="404",host="example.com",method="GET",url="/ping",le="0.005"}`, "response size should NOT have time bucket (like, 0.005s)")
0 commit comments