Documentation
¶
Overview ¶
Package profiler turns the SPX profiler on or off globally. Arming flips a config flag and regenerates every PHP-FPM site's nginx vhost so the SPX_ENABLED cookie is injected into each request; disarming reverses it. No FPM restart is involved, only an nginx reload.
Index ¶
Constants ¶
const SpxUIURL = "http://profiler.localhost/?SPX_UI_URI=/"
SpxUIURL is the standalone SPX profiler web UI, served by the profiler.localhost nginx vhost. The dashboard embeds the same UI same-origin under /_spx/; this URL opens it directly (lerd profile open, MCP status).
Variables ¶
This section is empty.
Functions ¶
func ClearData ¶
ClearData deletes every captured SPX report from the profiler data directory. The directory itself is kept so the read-write bind mount into each FPM container stays valid; only its contents go. A missing or empty directory is not an error. Returns how many top-level entries were removed.
func Profilable ¶ added in v1.30.0
Profilable reports whether a site's requests can be profiled at all: SPX lives in the FPM image, so it takes a PHP site served by FPM. FrankenPHP serves PHP from its own image without the extension, and custom-container and host-proxy sites run no PHP of lerd's. The dashboard gates its profile-this-route action on the same rule the vhost rewrite uses.
Types ¶
type Result ¶
Result reports the outcome of a SetProfiling call.
func SetProfiling ¶
SetProfiling turns the SPX profiler on or off globally. When on, every PHP-FPM site's requests are profiled. The change regenerates each FPM site's vhost and reloads nginx.