useDiagnostics
useDiagnostics(
options?):DiagnosticsResult
Defined in: console-sdk/src/react/hooks/useDiagnostics.ts:115
Reactive dev diagnostics: the bounded raw-packet ring, its parse-success
rate, and a clear() action (SDK_PLAN.md §3.6.8). Requires
config.diagnostics.rawPackets: true; returns the empty state otherwise.
Throws OutsideProviderError when no <ConsoleProvider> is above the caller.
The ring is frame-coalesced in the store, so even a high-throughput console re-renders a diagnostics screen at most once per animation frame.
Parameters
Section titled “Parameters”options?
Section titled “options?”optional capacity to cap the returned view to the newest N
packets (never enlarges the SDK’s ring).
Returns
Section titled “Returns”the visible packets, their parse-success rate, and clear().
Example
Section titled “Example”const { packets, parseSuccessRate, clear } = useDiagnostics({ capacity: 100 });// requires createConsoleConfig({ diagnostics: { rawPackets: true } })