Skip to content

TraceStore class

Namespace: Vitreous.DevUI.Tracing
Assembly: Vitreous.DevUI.dll

Thread-safe ring buffer that holds the last Capacity execution traces. New entries push out the oldest when the buffer is full. Optimized for a high-frequency write path and an infrequent bulk-read path (SSE replay).

public sealed class TraceStore

object ← TraceStore

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

public TraceStore(int capacity = 500)

capacity int

Maximum number of traces retained. Configurable via VitreousDevUIOptions.

public int Capacity { get; }

int

Returns the number of traces currently stored.

public int Count { get; }

int

Appends a trace to the ring buffer and fires TraceAdded. Thread-safe.

public void Append(ExecutionTrace trace)

trace ExecutionTrace

Returns all retained traces in chronological order (oldest first). Thread-safe snapshot — callers get a consistent view at the moment of the call.

public IReadOnlyList<ExecutionTrace> GetAll()

IReadOnlyList<ExecutionTrace>

Event raised synchronously, on the dispatching thread, after each new trace is appended. Handlers must be fast and must not throw.

public event Action<ExecutionTrace>? TraceAdded

Action<ExecutionTrace>?