DiagnosticBuffer

class DiagnosticBuffer(size: Int = DEFAULT_DIAGNOSTICS_BUFFER_SIZE)

A bounded, in-memory ring buffer of DiagnosticEvents. Retains the most recent capacity records so OptiViewAds.exportDiagnostics can produce a self-contained report without unbounded growth on long-running live sessions.

Constructors

Link copied to clipboard
constructor(size: Int = DEFAULT_DIAGNOSTICS_BUFFER_SIZE)

Properties

Link copied to clipboard

The number of records retained; a non-positive size falls back to DEFAULT_DIAGNOSTICS_BUFFER_SIZE.

Functions

Link copied to clipboard
fun clear()

Drop all retained records.

Link copied to clipboard

Return a copy of the retained records, oldest first.

Link copied to clipboard

Append a record, evicting the oldest when the buffer is full.