Fix the OpenMetrics response format returned by the FPM status page

Closes GH-7843, closes GH-7842
This commit is contained in:
Stefano Arlandini 2021-12-28 01:16:50 +01:00 committed by Jakub Zelenka
parent 4ae75623fd
commit 46bec6de42
3 changed files with 8 additions and 2 deletions

4
NEWS
View File

@ -23,6 +23,10 @@ PHP NEWS
- Filter:
. Fixed FILTER_FLAG_NO_RES_RANGE flag. (Yifan Tong)
- FPM:
. Fixed bug GH-7842 (Invalid OpenMetrics response format returned by FPM
status page. (Stefano Arlandini)
- Hash:
. Fixed bug GH-7759 (Incorrect return types for hash() and hash_hmac()).
(cmb)

View File

@ -430,7 +430,8 @@ int fpm_status_handle_request(void) /* {{{ */
"phpfpm_max_children_reached %u\n"
"# HELP phpfpm_slow_requests The number of requests that exceeded your 'request_slowlog_timeout' value.\n"
"# TYPE phpfpm_slow_requests counter\n"
"phpfpm_slow_requests %lu\n";
"phpfpm_slow_requests %lu\n"
"# EOF\n";
has_start_time = 0;
if (!full) {

View File

@ -241,7 +241,8 @@ class Status
"phpfpm_max_children_reached " . $fields['max children reached'] . "\n" .
"# HELP phpfpm_slow_requests The number of requests that exceeded your 'request_slowlog_timeout' value\.\n" .
"# TYPE phpfpm_slow_requests counter\n" .
"phpfpm_slow_requests " . $fields['slow requests'] . ")";
"phpfpm_slow_requests " . $fields['slow requests'] . "\n" .
"# EOF)\n";
if (!preg_match($pattern, $body)) {
echo "ERROR: Expected body does not match pattern\n";