profiler

package
v1.22.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: MIT Imports: 7 Imported by: 0

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

View Source
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

func ClearData() (int, error)

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.

Types

type Result

type Result struct {
	Enabled  bool `json:"enabled"`
	NoChange bool `json:"no_change"`
}

Result reports the outcome of a SetProfiling call.

func SetProfiling

func SetProfiling(on bool) (Result, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL