Title here
Summary here
Pionia records per-request metrics for Moonlight API calls and exposes them through a web dashboard and CLI.
| URL | Format |
|---|---|
/stats | HTML health dashboard |
/stats.json | Same data as JSON |
Enabled when DEBUG=true by default, or explicitly:
# environment/settings.ini
STATS_ENABLED = true# environment/.env — generate your own token; never commit a shared docs example
STATS_TOKEN=Generate a token locally:
openssl rand -hex 32Access the dashboard with ?token=<your-token> or header X-Stats-Token: <your-token>.
Disable stats in production or require a strong STATS_TOKEN. Do not leave /stats open without authentication when DEBUG=false.
php pionia stats:view # human-readable table
php pionia stats:view --json # JSON export
php pionia stats:view --reset # clear storage/metrics/requests.jsonlAliases: stats, viewstats.
To stop writing metrics while keeping the stats page:
[metrics]
ENABLED = false/__pionia/*) are excludedpionia/pionia-core Composer packageWhen [performance] RECORD_OPCACHE_SNAPSHOT=true, workers also write storage/metrics/opcache-snapshot.json for stats-driven preload generation (see Production performance).
optimize --production, preload strategies