Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
IndraGunawan committed Feb 24, 2025
1 parent 347727e commit 8816cb6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Optionally, the number of threads to create and [worker scripts](worker.md) to s
num <num> # Sets the number of PHP threads to start, defaults to 2x the number of available CPUs.
env <key> <value> # Sets an extra environment variable to the given value. Can be specified more than once for multiple environment variables.
watch <path> # Sets the path to watch for file changes. Can be specified more than once for multiple paths.
name <name> # Sets the name of the worker, used in logs and metrics. Default: absolute path of worker file
}
}
}
Expand Down
18 changes: 10 additions & 8 deletions docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

When [Caddy metrics](https://caddyserver.com/docs/metrics) are enabled, FrankenPHP exposes the following metrics:

* `frankenphp_[worker]_total_workers`: The total number of workers.
* `frankenphp_[worker]_busy_workers`: The number of workers currently processing a request.
* `frankenphp_[worker]_worker_request_time`: The time spent processing requests by all workers.
* `frankenphp_[worker]_worker_request_count`: The number of requests processed by all workers.
* `frankenphp_[worker]_ready_workers`: The number of workers that have called `frankenphp_handle_request` at least once.
* `frankenphp_[worker]_worker_crashes`: The number of times a worker has unexpectedly terminated.
* `frankenphp_[worker]_worker_restarts`: The number of times a worker has been deliberately restarted.
* `frankenphp_total_threads`: The total number of PHP threads.
* `frankenphp_busy_threads`: The number of PHP threads currently processing a request (running workers always consume a thread).
* `frankenphp_queue_depth`: The number of regular queued requests
* `frankenphp_total_workers{worker="[worker_name]"}`: The total number of workers.
* `frankenphp_busy_workers{worker="[worker_name]"}`: The number of workers currently processing a request.
* `frankenphp_worker_request_time{worker="[worker_name]"}`: The time spent processing requests by all workers.
* `frankenphp_worker_request_count{worker="[worker_name]"}`: The number of requests processed by all workers.
* `frankenphp_ready_workers{worker="[worker_name]"}`: The number of workers that have called `frankenphp_handle_request` at least once.
* `frankenphp_worker_crashes{worker="[worker_name]"}`: The number of times a worker has unexpectedly terminated.
* `frankenphp_worker_restarts{worker="[worker_name]"}`: The number of times a worker has been deliberately restarted.
* `frankenphp_worker_queue_depth{worker="[worker_name]"}`: The number of queued requests.

For worker metrics, the `[worker]` placeholder is replaced by the worker script path in the Caddyfile.
For worker metrics, the `[worker_name]` placeholder is replaced by the worker name in the Caddyfile.

0 comments on commit 8816cb6

Please sign in to comment.