<PackageReference Include="Relativity.Server.Telemetry.APM.SDK" Version="2019.10.9" />

PeriodicBatchingSink

public abstract class PeriodicBatchingSink : IDisposable
Base class for sinks that send events in batches. Batching is triggered asynchronously on a timer.
protected ILog Logger { get; protected set; }

public long MessageCount { get; }

public long PendingCount { get; }

protected PeriodicBatchingSink(int batchSizeLimit, TimeSpan period)

Construct a sink posting to the specified destination.

protected PeriodicBatchingSink(int batchSizeLimit, TimeSpan period, int queueLimit)

Construct a sink posting to the specified database.

protected virtual bool CanInclude(object evt)

Determine whether a queued event should be included in the batch. If an override returns false, the event will be dropped.

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

protected virtual void Dispose(bool disposing)

Free resources held by the sink.

protected virtual void DisposeChild()

protected virtual void OnEmptyBatch()

Allows derived sinks to perform periodic work without requiring additional threads or timers (thus avoiding additional flush/shut-down complexity).

protected virtual Task OnEmptyBatchAsync()

Allows derived sinks to perform periodic work without requiring additional threads or timers (thus avoiding additional flush/shut-down complexity).

public virtual void Send(MeterResult meter)

Sends the specified meter result.

public virtual void Send(TimerResult timer)

Sends the specified timer result.

public virtual void Send(HealthCheckResult health)

Sends the specified health result.

public virtual void Send<T>(GaugeResult<T> gauge)

Sends the specified gauge result.

public virtual void Send(CounterResult counter)

Sends the specified counter result.

protected virtual bool SendBatch(IEnumerable<IMeasureResult> events)

Emit a batch of events, running to completion synchronously.

protected virtual Task<bool> SendBatchAsync(IEnumerable<IMeasureResult> events)

Emit a batch of events, running asynchronously.

protected void SendGeneric(IMeasureResult metric)

Emit the provided event to the sink. If the sink is being disposed or the app domain unloaded, then the event is ignored.

protected string ToJson(IMeasureResult measureResult)

Converts metrics to JSON format.