Table of Contents

Interface IMediatorMetrics

Namespace
SimpleMediator
Assembly
SimpleMediator.dll

Defines the metrics exposed by SimpleMediator.

public interface IMediatorMetrics

Remarks

Can be customized to integrate with other observability systems (Application Insights, Prometheus, and so on). The default implementation uses Meter.

Methods

TrackFailure(string, string, TimeSpan, string)

Records a failed request execution, either functional or exceptional.

void TrackFailure(string requestKind, string requestName, TimeSpan duration, string reason)

Parameters

requestKind string

Logical request kind.

requestName string

Friendly name for the request.

duration TimeSpan

Elapsed time before the failure.

reason string

Code or description of the failure reason.

TrackSuccess(string, string, TimeSpan)

Records a successful request execution.

void TrackSuccess(string requestKind, string requestName, TimeSpan duration)

Parameters

requestKind string

Logical request kind (for example, command or query).

requestName string

Friendly name for the request.

duration TimeSpan

Total time spent by the pipeline.