Skip to content

Commit

Permalink
Fix GH-14175: Use two digit float specifier for FPM systemd format re…
Browse files Browse the repository at this point in the history
…q rate

Close GH-14175
  • Loading branch information
bcremer authored and bukka committed May 12, 2024
1 parent 1e2a2d7 commit 5b6cda6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ PHP NEWS
. Fix crash in ParentNode::append() when dealing with a fragment
containing text nodes. (nielsdos)

- FPM:
. Fix bug GH-14175 (Show decimal number instead of scientific notation in
systemd status). (Benjamin Cremer)

- Hash:
. ext/hash: Swap the checking order of `__has_builtin` and `__GNUC__`
(Saki Takamachi)
Expand Down
4 changes: 2 additions & 2 deletions sapi/fpm/fpm/fpm_systemd.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ static void fpm_systemd(void)
}

/*
zlog(ZLOG_DEBUG, "systemd %s (Processes active:%d, idle:%d, Requests:%lu, slow:%lu, Traffic:%.3greq/sec)",
zlog(ZLOG_DEBUG, "systemd %s (Processes active:%d, idle:%d, Requests:%lu, slow:%lu, Traffic:%.2freq/sec)",
fpm_global_config.systemd_watchdog ? "watchdog" : "heartbeat",
active, idle, requests, slow_req, ((float)requests - last) * 1000.0 / fpm_global_config.systemd_interval);
*/

if (0 > sd_notifyf(0, "READY=1\n%s"
"STATUS=Processes active: %d, idle: %d, Requests: %lu, slow: %lu, Traffic: %.3greq/sec",
"STATUS=Processes active: %d, idle: %d, Requests: %lu, slow: %lu, Traffic: %.2freq/sec",
fpm_global_config.systemd_watchdog ? "WATCHDOG=1\n" : "",
active, idle, requests, slow_req, ((float)requests - last) * 1000.0 / fpm_global_config.systemd_interval)) {
zlog(ZLOG_NOTICE, "failed to notify status to systemd");
Expand Down

0 comments on commit 5b6cda6

Please sign in to comment.