Debug
in package
Request diagnostics, collected while DEBUG is on: every executed query with its wall time (fed by DebugStatement), reported as a `Server-Timing` header (browser devtools, curl) and as the query panel at the bottom of the page.
Table of Contents
Properties
- $queries : array<int, array{sql: string, ms: float}>
Methods
- metrics() : array{db: float, queries: int, app: float, mem: float}
- Request metrics so far: db time (ms), query count, app time (ms) and peak memory (MB). Shared by the header and the query panel. Memory is the peak the script itself used, not the 2 MB blocks the allocator reserves, which would flatline at 2.0 for an app this size.
- queries() : array<int, array{sql: string, ms: float, runs: int}>
- Executed queries in order, each with how many times its SQL ran in the request (`runs` > 1 flags repeated queries, the N+1 smell).
- query() : void
- reset() : void
- serverTiming() : string
Properties
$queries
private
static array<int, array{sql: string, ms: float}>
$queries
= []
Methods
metrics()
Request metrics so far: db time (ms), query count, app time (ms) and peak memory (MB). Shared by the header and the query panel. Memory is the peak the script itself used, not the 2 MB blocks the allocator reserves, which would flatline at 2.0 for an app this size.
public
static metrics() : array{db: float, queries: int, app: float, mem: float}
Return values
array{db: float, queries: int, app: float, mem: float}queries()
Executed queries in order, each with how many times its SQL ran in the request (`runs` > 1 flags repeated queries, the N+1 smell).
public
static queries() : array<int, array{sql: string, ms: float, runs: int}>
Return values
array<int, array{sql: string, ms: float, runs: int}>query()
public
static query(string $sql, float $ms) : void
Parameters
- $sql : string
- $ms : float
reset()
public
static reset() : void
serverTiming()
public
static serverTiming() : string