-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Metricbeat] Add http endpoint tests for php_fpm module (#11088)
This change is based on #10648 to migrate to golden files instead of the dynamically generated data files. This adds also support for query params to the testing framework.
- Loading branch information
Showing
11 changed files
with
166 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
type: http | ||
url: "/status?json=" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"pool":"www","process manager":"dynamic","start time":1551792028,"start since":3589,"accepted conn":18,"listen queue":0,"max listen queue":0,"listen queue len":0,"idle processes":1,"active processes":1,"total processes":2,"max active processes":1,"max children reached":0,"slow requests":0} |
38 changes: 38 additions & 0 deletions
38
metricbeat/module/php_fpm/pool/_meta/testdata/docs.json-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[ | ||
{ | ||
"event": { | ||
"dataset": "php_fpm.pool", | ||
"duration": 115000, | ||
"module": "php_fpm" | ||
}, | ||
"metricset": { | ||
"name": "pool" | ||
}, | ||
"php_fpm": { | ||
"pool": { | ||
"connections": { | ||
"accepted": 18, | ||
"listen_queue_len": 0, | ||
"max_listen_queue": 0, | ||
"queued": 0 | ||
}, | ||
"name": "www", | ||
"process_manager": "dynamic", | ||
"processes": { | ||
"active": 1, | ||
"idle": 1, | ||
"max_active": 1, | ||
"max_children_reached": 0, | ||
"total": 2 | ||
}, | ||
"slow_requests": 0, | ||
"start_since": 3589, | ||
"start_time": 1551792028 | ||
} | ||
}, | ||
"service": { | ||
"address": "127.0.0.1:55555", | ||
"type": "php_fpm" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
type: http | ||
url: "/status?full=&json=" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"pool":"www","process manager":"dynamic","start time":1551792028,"start since":3471,"accepted conn":17,"listen queue":0,"max listen queue":0,"listen queue len":0,"idle processes":1,"active processes":1,"total processes":2,"max active processes":1,"max children reached":0,"slow requests":0, "processes":[{"pid":24,"state":"Running","start time":1551792028,"start since":3471,"requests":9,"request duration":135,"request method":"GET","request uri":"/status?full&json","content length":0,"user":"-","script":"-","last request cpu":0.00,"last request memory":0},{"pid":25,"state":"Idle","start time":1551792028,"start since":3471,"requests":8,"request duration":811,"request method":"GET","request uri":"/status?full","content length":0,"user":"-","script":"-","last request cpu":0.00,"last request memory":2097152}]} |
98 changes: 98 additions & 0 deletions
98
metricbeat/module/php_fpm/process/_meta/testdata/docs.json-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
[ | ||
{ | ||
"event": { | ||
"dataset": "php_fpm.process", | ||
"duration": 115000, | ||
"module": "php_fpm" | ||
}, | ||
"http": { | ||
"request": { | ||
"method": "get" | ||
}, | ||
"response": { | ||
"body": { | ||
"bytes": 0 | ||
} | ||
} | ||
}, | ||
"metricset": { | ||
"name": "process" | ||
}, | ||
"php_fpm": { | ||
"pool": { | ||
"name": "www" | ||
}, | ||
"process": { | ||
"last_request_cpu": 0, | ||
"last_request_memory": 0, | ||
"request_duration": 135, | ||
"requests": 9, | ||
"script": "-", | ||
"start_since": 3471, | ||
"start_time": 1551792028, | ||
"state": "Running" | ||
} | ||
}, | ||
"process": { | ||
"pid": 24 | ||
}, | ||
"service": { | ||
"address": "127.0.0.1:55555", | ||
"type": "php_fpm" | ||
}, | ||
"url": { | ||
"original": "/status?full\u0026json" | ||
}, | ||
"user": { | ||
"name": "-" | ||
} | ||
}, | ||
{ | ||
"event": { | ||
"dataset": "php_fpm.process", | ||
"duration": 115000, | ||
"module": "php_fpm" | ||
}, | ||
"http": { | ||
"request": { | ||
"method": "get" | ||
}, | ||
"response": { | ||
"body": { | ||
"bytes": 0 | ||
} | ||
} | ||
}, | ||
"metricset": { | ||
"name": "process" | ||
}, | ||
"php_fpm": { | ||
"pool": { | ||
"name": "www" | ||
}, | ||
"process": { | ||
"last_request_cpu": 0, | ||
"last_request_memory": 2097152, | ||
"request_duration": 811, | ||
"requests": 8, | ||
"script": "-", | ||
"start_since": 3471, | ||
"start_time": 1551792028, | ||
"state": "Idle" | ||
} | ||
}, | ||
"process": { | ||
"pid": 25 | ||
}, | ||
"service": { | ||
"address": "127.0.0.1:55555", | ||
"type": "php_fpm" | ||
}, | ||
"url": { | ||
"original": "/status?full" | ||
}, | ||
"user": { | ||
"name": "-" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters