final class HttpMetrics (View source)

Freezes one completed HTTP interval and its SQL totals without retaining request data.

PHP peak memory is the script's peak reported by PHP, not a request-local peak in a persistent worker. Values are supplied by the lifecycle owner and never re-read.

Methods

__construct(float $durationMs, int $phpPeakMemoryBytes, int $sqlCount, float $sqlMs)

Accepts finite, non-negative measurements in milliseconds and bytes.

float

Returns the completed HTTP interval in milliseconds, without reading the clock again.

float
int

Returns the PHP script/process peak in bytes sampled at completion.

int
int

Returns the captured SQL attempt count, including failed executions.

int
float
sqlMs()

Returns the captured SQL milliseconds, excluding connection setup and observer execution.

float

Details

__construct

__construct(float $durationMs, int $phpPeakMemoryBytes, int $sqlCount, float $sqlMs)

Accepts finite, non-negative measurements in milliseconds and bytes.

Parameters

float $durationMs
int $phpPeakMemoryBytes
int $sqlCount
float $sqlMs

Exceptions

InvalidArgumentException

durationMs

float durationMs()

Returns the completed HTTP interval in milliseconds, without reading the clock again.

Return Value

float

phpPeakMemoryBytes

int phpPeakMemoryBytes()

Returns the PHP script/process peak in bytes sampled at completion.

Return Value

int

sqlCount

int sqlCount()

Returns the captured SQL attempt count, including failed executions.

Return Value

int

sqlMs

float sqlMs()

Returns the captured SQL milliseconds, excluding connection setup and observer execution.

Return Value

float