@@ -6,42 +6,42 @@ import "time"
66
77var (
88 expReqs = []handlerConfig {
9- {Path : "/test/1" , Method : "GET" , Code : 201 , ReturnData : "1" , sleepDuration : 45 * time .Millisecond },
10- {Path : "/test/2" , Method : "POST" , Code : 202 , ReturnData : "22" , sleepDuration : 95 * time .Millisecond },
11- {Path : "/test/3" , Method : "PATCH" , Code : 203 , ReturnData : "333" , sleepDuration : 145 * time .Millisecond },
12- {Path : "/test/4" , Method : "DELETE" , Code : 205 , ReturnData : "4444" , sleepDuration : 195 * time .Millisecond },
9+ {Path : "/test/1" , Method : "GET" , Code : 201 , ReturnData : "1" , SleepDuration : 45 * time .Millisecond , NumberRequests : 10 },
10+ {Path : "/test/2" , Method : "POST" , Code : 202 , ReturnData : "22" , SleepDuration : 95 * time .Millisecond , NumberRequests : 9 },
11+ {Path : "/test/3" , Method : "PATCH" , Code : 203 , ReturnData : "333" , SleepDuration : 145 * time .Millisecond , NumberRequests : 8 },
12+ {Path : "/test/4" , Method : "DELETE" , Code : 205 , ReturnData : "4444" , SleepDuration : 195 * time .Millisecond , NumberRequests : 7 },
1313 }
1414
1515 expMetrics = []string {
1616 `# HELP http_request_duration_seconds The latency of the HTTP requests.` ,
1717 `# TYPE http_request_duration_seconds histogram` ,
18- `http_request_duration_seconds_bucket{code="201",handler="/test/1",method="GET",service="integration",le="0.05"} 1 ` ,
19- `http_request_duration_seconds_bucket{code="201",handler="/test/1",method="GET",service="integration",le="0.1"} 1 ` ,
20- `http_request_duration_seconds_bucket{code="201",handler="/test/1",method="GET",service="integration",le="0.15"} 1 ` ,
21- `http_request_duration_seconds_bucket{code="201",handler="/test/1",method="GET",service="integration",le="0.2"} 1 ` ,
22- `http_request_duration_seconds_bucket{code="201",handler="/test/1",method="GET",service="integration",le="+Inf"} 1 ` ,
23- `http_request_duration_seconds_count{code="201",handler="/test/1",method="GET",service="integration"} 1 ` ,
18+ `http_request_duration_seconds_bucket{code="201",handler="/test/1",method="GET",service="integration",le="0.05"} 10 ` ,
19+ `http_request_duration_seconds_bucket{code="201",handler="/test/1",method="GET",service="integration",le="0.1"} 10 ` ,
20+ `http_request_duration_seconds_bucket{code="201",handler="/test/1",method="GET",service="integration",le="0.15"} 10 ` ,
21+ `http_request_duration_seconds_bucket{code="201",handler="/test/1",method="GET",service="integration",le="0.2"} 10 ` ,
22+ `http_request_duration_seconds_bucket{code="201",handler="/test/1",method="GET",service="integration",le="+Inf"} 10 ` ,
23+ `http_request_duration_seconds_count{code="201",handler="/test/1",method="GET",service="integration"} 10 ` ,
2424
2525 `http_request_duration_seconds_bucket{code="202",handler="/test/2",method="POST",service="integration",le="0.05"} 0` ,
26- `http_request_duration_seconds_bucket{code="202",handler="/test/2",method="POST",service="integration",le="0.1"} 1 ` ,
27- `http_request_duration_seconds_bucket{code="202",handler="/test/2",method="POST",service="integration",le="0.15"} 1 ` ,
28- `http_request_duration_seconds_bucket{code="202",handler="/test/2",method="POST",service="integration",le="0.2"} 1 ` ,
29- `http_request_duration_seconds_bucket{code="202",handler="/test/2",method="POST",service="integration",le="+Inf"} 1 ` ,
30- `http_request_duration_seconds_count{code="202",handler="/test/2",method="POST",service="integration"} 1 ` ,
26+ `http_request_duration_seconds_bucket{code="202",handler="/test/2",method="POST",service="integration",le="0.1"} 9 ` ,
27+ `http_request_duration_seconds_bucket{code="202",handler="/test/2",method="POST",service="integration",le="0.15"} 9 ` ,
28+ `http_request_duration_seconds_bucket{code="202",handler="/test/2",method="POST",service="integration",le="0.2"} 9 ` ,
29+ `http_request_duration_seconds_bucket{code="202",handler="/test/2",method="POST",service="integration",le="+Inf"} 9 ` ,
30+ `http_request_duration_seconds_count{code="202",handler="/test/2",method="POST",service="integration"} 9 ` ,
3131
3232 `http_request_duration_seconds_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="0.05"} 0` ,
3333 `http_request_duration_seconds_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="0.1"} 0` ,
34- `http_request_duration_seconds_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="0.15"} 1 ` ,
35- `http_request_duration_seconds_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="0.2"} 1 ` ,
36- `http_request_duration_seconds_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="+Inf"} 1 ` ,
37- `http_request_duration_seconds_count{code="203",handler="/test/3",method="PATCH",service="integration"} 1 ` ,
34+ `http_request_duration_seconds_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="0.15"} 8 ` ,
35+ `http_request_duration_seconds_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="0.2"} 8 ` ,
36+ `http_request_duration_seconds_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="+Inf"} 8 ` ,
37+ `http_request_duration_seconds_count{code="203",handler="/test/3",method="PATCH",service="integration"} 8 ` ,
3838
3939 `http_request_duration_seconds_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="0.05"} 0` ,
4040 `http_request_duration_seconds_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="0.1"} 0` ,
4141 `http_request_duration_seconds_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="0.15"} 0` ,
42- `http_request_duration_seconds_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="0.2"} 1 ` ,
43- `http_request_duration_seconds_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="+Inf"} 1 ` ,
44- `http_request_duration_seconds_count{code="205",handler="/test/4",method="DELETE",service="integration"} 1 ` ,
42+ `http_request_duration_seconds_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="0.2"} 7 ` ,
43+ `http_request_duration_seconds_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="+Inf"} 7 ` ,
44+ `http_request_duration_seconds_count{code="205",handler="/test/4",method="DELETE",service="integration"} 7 ` ,
4545
4646 `# HELP http_requests_inflight The number of inflight requests being handled at the same time.` ,
4747 `# TYPE http_requests_inflight gauge` ,
@@ -52,40 +52,40 @@ var (
5252
5353 `# HELP http_response_size_bytes The size of the HTTP responses.` ,
5454 `# TYPE http_response_size_bytes histogram` ,
55- `http_response_size_bytes_bucket{code="201",handler="/test/1",method="GET",service="integration",le="1"} 1 ` ,
56- `http_response_size_bytes_bucket{code="201",handler="/test/1",method="GET",service="integration",le="2"} 1 ` ,
57- `http_response_size_bytes_bucket{code="201",handler="/test/1",method="GET",service="integration",le="3"} 1 ` ,
58- `http_response_size_bytes_bucket{code="201",handler="/test/1",method="GET",service="integration",le="4"} 1 ` ,
59- `http_response_size_bytes_bucket{code="201",handler="/test/1",method="GET",service="integration",le="5"} 1 ` ,
60- `http_response_size_bytes_bucket{code="201",handler="/test/1",method="GET",service="integration",le="+Inf"} 1 ` ,
61- `http_response_size_bytes_sum{code="201",handler="/test/1",method="GET",service="integration"} 1 ` ,
62- `http_response_size_bytes_count{code="201",handler="/test/1",method="GET",service="integration"} 1 ` ,
55+ `http_response_size_bytes_bucket{code="201",handler="/test/1",method="GET",service="integration",le="1"} 10 ` ,
56+ `http_response_size_bytes_bucket{code="201",handler="/test/1",method="GET",service="integration",le="2"} 10 ` ,
57+ `http_response_size_bytes_bucket{code="201",handler="/test/1",method="GET",service="integration",le="3"} 10 ` ,
58+ `http_response_size_bytes_bucket{code="201",handler="/test/1",method="GET",service="integration",le="4"} 10 ` ,
59+ `http_response_size_bytes_bucket{code="201",handler="/test/1",method="GET",service="integration",le="5"} 10 ` ,
60+ `http_response_size_bytes_bucket{code="201",handler="/test/1",method="GET",service="integration",le="+Inf"} 10 ` ,
61+ `http_response_size_bytes_sum{code="201",handler="/test/1",method="GET",service="integration"} 10 ` ,
62+ `http_response_size_bytes_count{code="201",handler="/test/1",method="GET",service="integration"} 10 ` ,
6363
6464 `http_response_size_bytes_bucket{code="202",handler="/test/2",method="POST",service="integration",le="1"} 0` ,
65- `http_response_size_bytes_bucket{code="202",handler="/test/2",method="POST",service="integration",le="2"} 1 ` ,
66- `http_response_size_bytes_bucket{code="202",handler="/test/2",method="POST",service="integration",le="3"} 1 ` ,
67- `http_response_size_bytes_bucket{code="202",handler="/test/2",method="POST",service="integration",le="4"} 1 ` ,
68- `http_response_size_bytes_bucket{code="202",handler="/test/2",method="POST",service="integration",le="5"} 1 ` ,
69- `http_response_size_bytes_bucket{code="202",handler="/test/2",method="POST",service="integration",le="+Inf"} 1 ` ,
70- `http_response_size_bytes_sum{code="202",handler="/test/2",method="POST",service="integration"} 2 ` ,
71- `http_response_size_bytes_count{code="202",handler="/test/2",method="POST",service="integration"} 1 ` ,
65+ `http_response_size_bytes_bucket{code="202",handler="/test/2",method="POST",service="integration",le="2"} 9 ` ,
66+ `http_response_size_bytes_bucket{code="202",handler="/test/2",method="POST",service="integration",le="3"} 9 ` ,
67+ `http_response_size_bytes_bucket{code="202",handler="/test/2",method="POST",service="integration",le="4"} 9 ` ,
68+ `http_response_size_bytes_bucket{code="202",handler="/test/2",method="POST",service="integration",le="5"} 9 ` ,
69+ `http_response_size_bytes_bucket{code="202",handler="/test/2",method="POST",service="integration",le="+Inf"} 9 ` ,
70+ `http_response_size_bytes_sum{code="202",handler="/test/2",method="POST",service="integration"} 18 ` ,
71+ `http_response_size_bytes_count{code="202",handler="/test/2",method="POST",service="integration"} 9 ` ,
7272
7373 `http_response_size_bytes_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="1"} 0` ,
7474 `http_response_size_bytes_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="2"} 0` ,
75- `http_response_size_bytes_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="3"} 1 ` ,
76- `http_response_size_bytes_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="4"} 1 ` ,
77- `http_response_size_bytes_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="5"} 1 ` ,
78- `http_response_size_bytes_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="+Inf"} 1 ` ,
79- `http_response_size_bytes_sum{code="203",handler="/test/3",method="PATCH",service="integration"} 3 ` ,
80- `http_response_size_bytes_count{code="203",handler="/test/3",method="PATCH",service="integration"} 1 ` ,
75+ `http_response_size_bytes_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="3"} 8 ` ,
76+ `http_response_size_bytes_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="4"} 8 ` ,
77+ `http_response_size_bytes_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="5"} 8 ` ,
78+ `http_response_size_bytes_bucket{code="203",handler="/test/3",method="PATCH",service="integration",le="+Inf"} 8 ` ,
79+ `http_response_size_bytes_sum{code="203",handler="/test/3",method="PATCH",service="integration"} 24 ` ,
80+ `http_response_size_bytes_count{code="203",handler="/test/3",method="PATCH",service="integration"} 8 ` ,
8181
8282 `http_response_size_bytes_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="1"} 0` ,
8383 `http_response_size_bytes_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="2"} 0` ,
8484 `http_response_size_bytes_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="3"} 0` ,
85- `http_response_size_bytes_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="4"} 1 ` ,
86- `http_response_size_bytes_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="5"} 1 ` ,
87- `http_response_size_bytes_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="+Inf"} 1 ` ,
88- `http_response_size_bytes_sum{code="205",handler="/test/4",method="DELETE",service="integration"} 4 ` ,
89- `http_response_size_bytes_count{code="205",handler="/test/4",method="DELETE",service="integration"} 1 ` ,
85+ `http_response_size_bytes_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="4"} 7 ` ,
86+ `http_response_size_bytes_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="5"} 7 ` ,
87+ `http_response_size_bytes_bucket{code="205",handler="/test/4",method="DELETE",service="integration",le="+Inf"} 7 ` ,
88+ `http_response_size_bytes_sum{code="205",handler="/test/4",method="DELETE",service="integration"} 28 ` ,
89+ `http_response_size_bytes_count{code="205",handler="/test/4",method="DELETE",service="integration"} 7 ` ,
9090 }
9191)
0 commit comments