DashboardSnapshot
An immutable read of DashboardState at one point in time — everything DashboardView needs to draw one frame, with no further computation or I/O required.
Kept separate from DashboardState so rendering logic can be pure and unit-tested against a hand-built snapshot without touching the mutable store at all.
Synopsis
Section titled “Synopsis”final class DashboardSnapshot
| Source | DashboardSnapshot.php |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
$avgLatencyMs | float | readonly. |
$cpuSystemMs | float | readonly. |
$cpuUserMs | float | readonly. |
$errorRate | float | readonly. |
$hasData | bool | readonly. |
$latencySeries | array | readonly. |
$maxLatencyMs | float | readonly. |
$memoryPeakBytes | float | readonly. |
$p95LatencyMs | float | readonly. |
$recentErrors | array | readonly. |
$recentSpans | array | readonly. |
$requestsPerSecond | float | readonly. |
$routeRows | array | readonly. |
$throughputSeries | array | readonly. |
$totalErrors | int | readonly. |
$totalRequests | int | readonly. |
$uptimeSeconds | int | readonly. |
$workerRssBytes | float | readonly. |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(bool $hasData, int $uptimeSeconds, int $totalRequests, int $totalErrors, float $requestsPerSecond, float $errorRate, float $avgLatencyMs, float $p95LatencyMs, float $maxLatencyMs, float $cpuUserMs, float $cpuSystemMs, float $memoryPeakBytes, float $workerRssBytes, array<float> $throughputSeries, array<float> $latencySeries, list<array{route: string, count: int, avgMs: float, errorRate: float, cacheHitRate: float, lastSeenSecond: int}> $routeRows, list<array{second: int, traceId: string, name: string, statusCode: int, durationMs: float, isError: bool, statusMessage: string}> $recentSpans, list<array{second: int, traceId: string, name: string, statusCode: int, durationMs: float, isError: bool, statusMessage: string}> $recentErrors): mixed
most recent first
| Parameter | Type | Description |
|---|---|---|
$hasData | bool | |
$uptimeSeconds | int | |
$totalRequests | int | |
$totalErrors | int | |
$requestsPerSecond | float | |
$errorRate | float | |
$avgLatencyMs | float | |
$p95LatencyMs | float | |
$maxLatencyMs | float | |
$cpuUserMs | float | |
$cpuSystemMs | float | |
$memoryPeakBytes | float | |
$workerRssBytes | float | |
$throughputSeries | array``<``float``> | per-second request counts, chronological, one entry per second in the window |
$latencySeries | array``<``float``> | per-second average latency (ms), chronological, aligned with $throughputSeries |
$routeRows | list``<``array{route: string, count: int, avgMs: float, errorRate: float, cacheHitRate: float, lastSeenSecond: int}``> | |
$recentSpans | list``<``array{second: int, traceId: string, name: string, statusCode: int, durationMs: float, isError: bool, statusMessage: string}``> | most recent first |
$recentErrors | list``<``array{second: int, traceId: string, name: string, statusCode: int, durationMs: float, isError: bool, statusMessage: string}``> | most recent first |
Returns mixed