Table of Contents

Class CacheHealthMonitor

Namespace
Excalibur.Dispatch.Caching
Assembly
Excalibur.Dispatch.Caching.dll

Implementation of cache health monitoring.

public sealed class CacheHealthMonitor : ICacheHealthMonitor
Inheritance
CacheHealthMonitor
Implements
Inherited Members
Extension Methods

Remarks

Initializes a new instance of the CacheHealthMonitor class.

Constructors

CacheHealthMonitor(IConnectionMultiplexer?)

Implementation of cache health monitoring.

public CacheHealthMonitor(IConnectionMultiplexer? connectionMultiplexer = null)

Parameters

connectionMultiplexer IConnectionMultiplexer

Optional Redis connection multiplexer for health checks.

Remarks

Initializes a new instance of the CacheHealthMonitor class.

Methods

GetHealthStatusAsync(CancellationToken)

Gets the current cache health status.

public Task<CacheHealthStatus> GetHealthStatusAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<CacheHealthStatus>

A task representing the asynchronous operation, containing the cache health status.

GetPerformanceSnapshot()

Gets basic cache performance metrics.

public CachePerformanceSnapshot GetPerformanceSnapshot()

Returns

CachePerformanceSnapshot

A snapshot of cache performance metrics.

RecordCacheOperation(bool, bool)

Records a cache operation for monitoring.

public void RecordCacheOperation(bool isHit, bool hasError = false)

Parameters

isHit bool

True if the operation was a cache hit; otherwise, false.

hasError bool

True if the operation resulted in an error; otherwise, false.