Skip to content

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.

final class DashboardSnapshot

SourceDashboardSnapshot.php
PropertyTypeDescription
$avgLatencyMsfloatreadonly.
$cpuSystemMsfloatreadonly.
$cpuUserMsfloatreadonly.
$errorRatefloatreadonly.
$hasDataboolreadonly.
$latencySeriesarrayreadonly.
$maxLatencyMsfloatreadonly.
$memoryPeakBytesfloatreadonly.
$p95LatencyMsfloatreadonly.
$recentErrorsarrayreadonly.
$recentSpansarrayreadonly.
$requestsPerSecondfloatreadonly.
$routeRowsarrayreadonly.
$throughputSeriesarrayreadonly.
$totalErrorsintreadonly.
$totalRequestsintreadonly.
$uptimeSecondsintreadonly.
$workerRssBytesfloatreadonly.

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

ParameterTypeDescription
$hasDatabool
$uptimeSecondsint
$totalRequestsint
$totalErrorsint
$requestsPerSecondfloat
$errorRatefloat
$avgLatencyMsfloat
$p95LatencyMsfloat
$maxLatencyMsfloat
$cpuUserMsfloat
$cpuSystemMsfloat
$memoryPeakBytesfloat
$workerRssBytesfloat
$throughputSeriesarray``<``float``>per-second request counts, chronological, one entry per second in the window
$latencySeriesarray``<``float``>per-second average latency (ms), chronological, aligned with $throughputSeries
$routeRowslist``<``array{route: string, count: int, avgMs: float, errorRate: float, cacheHitRate: float, lastSeenSecond: int}``>
$recentSpanslist``<``array{second: int, traceId: string, name: string, statusCode: int, durationMs: float, isError: bool, statusMessage: string}``>most recent first
$recentErrorslist``<``array{second: int, traceId: string, name: string, statusCode: int, durationMs: float, isError: bool, statusMessage: string}``>most recent first

Returns mixed