<PackageReference Include="OpenTelemetry" Version="1.11.2" />

OpenTelemetry.Internal.CircularBuffer<T>

sealed class CircularBuffer<T>
Lock-free implementation of single-reader multi-writer circular buffer.
public long AddedCount { get; }

Gets the number of items added to the CircularBuffer<T>.

public int Capacity { get; }

Gets the capacity of the CircularBuffer<T>.

public int Count { get; }

Gets the number of items contained in the CircularBuffer<T>.

public long RemovedCount { get; }

Gets the number of items removed from the CircularBuffer<T>.

public CircularBuffer(int capacity)

Initializes a new instance of the CircularBuffer<T> class.

public bool Add(T value)

Adds the specified item to the buffer.

public T Read()

Reads an item from the CircularBuffer<T>.

public bool TryAdd(T value, int maxSpinCount)

Attempts to add the specified item to the buffer.