Skip to content

DiagnosticsAPI

Defined in: diagnostics/Diagnostics.ts:68

new DiagnosticsAPI(options?): DiagnosticsAPI

Defined in: diagnostics/Diagnostics.ts:80

DiagnosticsOptions = {}

DiagnosticsAPI

get dropped(): number

Defined in: diagnostics/Diagnostics.ts:141

New problems that were not tracked because DiagnosticsOptions.maxDistinct was reached. A non-zero value here means the report is incomplete, and a sink should say so rather than let it read as the whole picture.

number


get events(): readonly DiagnosticEvent[]

Defined in: diagnostics/Diagnostics.ts:134

The distinct problems seen since the last flush, oldest first.

readonly DiagnosticEvent[]

clear(): void

Defined in: diagnostics/Diagnostics.ts:181

Drop everything without sending.

void


flush(): void

Defined in: diagnostics/Diagnostics.ts:153

Hand everything accumulated to the sink and start a new window.

Clears even when there is no sink: the alternative is a game that never installs one accumulating counts forever, and a count since boot is not what the API promises. What survives with no sink is the aggregation, not an unbounded history.

void


report(report): void

Defined in: diagnostics/Diagnostics.ts:96

Report a problem. Repeats of one already seen increment its count.

DiagnosticReport

void


reportError(kind, error, source?): void

Defined in: diagnostics/Diagnostics.ts:129

Report something thrown, taking the message and stack off it.

DiagnosticKind

unknown

string

void


setSink(sink): void

Defined in: diagnostics/Diagnostics.ts:90

Install where diagnostics go, or null to stop sending (events still aggregate locally). Installing a sink hands it whatever has already accumulated — a game that installs one after boot does not lose the boot.

DiagnosticsSink | null

void


tick(deltaSeconds): void

Defined in: diagnostics/Diagnostics.ts:174

Advance the flush clock. Driven by the plugin’s system, not a timer — a background tab or a suspended mini-game should not be flushing.

number

void