RefreshAhead.MemoryCache.HealthChecks
1.1.2
dotnet add package RefreshAhead.MemoryCache.HealthChecks --version 1.1.2
NuGet\Install-Package RefreshAhead.MemoryCache.HealthChecks -Version 1.1.2
<PackageReference Include="RefreshAhead.MemoryCache.HealthChecks" Version="1.1.2" />
<PackageVersion Include="RefreshAhead.MemoryCache.HealthChecks" Version="1.1.2" />
<PackageReference Include="RefreshAhead.MemoryCache.HealthChecks" />
paket add RefreshAhead.MemoryCache.HealthChecks --version 1.1.2
#r "nuget: RefreshAhead.MemoryCache.HealthChecks, 1.1.2"
#:package RefreshAhead.MemoryCache.HealthChecks@1.1.2
#addin nuget:?package=RefreshAhead.MemoryCache.HealthChecks&version=1.1.2
#tool nuget:?package=RefreshAhead.MemoryCache.HealthChecks&version=1.1.2
RefreshAhead.MemoryCache.HealthChecks
A health check for RefreshAhead.MemoryCache. It reports the warm-up and refresh state of every registered refresh-ahead memory cache through Microsoft.Extensions.Diagnostics.HealthChecks.
This is a separate package so the core RefreshAhead.MemoryCache library stays lightweight and does not force a health-checks dependency on consumers that do not need it.
Install
dotnet add package RefreshAhead.MemoryCache.HealthChecks
Targets net8.0 and net10.0. Depends on RefreshAhead.MemoryCache.
Usage
builder.Services
.AddHealthChecks()
.AddRefreshAheadMemoryCaches();
It reports:
| Status | When |
|---|---|
| Unhealthy (or the configured failure status) | a refresh loop faulted, or a cache is not warm after it was due to run. |
| Degraded | a warm cache's latest attempt failed, or its last success exceeds an optional maximum age. |
| Healthy | caches are operating normally, including delayed-first-run caches that are not due yet. |
Per-cache running/faulted state, duration, next run, timestamps, counters, and errors are included in the health-check data.
Customize the registration:
builder.Services
.AddHealthChecks()
.AddRefreshAheadMemoryCaches(
name: "caches",
failureStatus: HealthStatus.Degraded,
tags: ["ready"]);
Tagging with ready and mapping a readiness endpoint filtered on that tag pairs naturally with WarmUpOnStart: the pod reports not-ready until its caches are warm.
Scope a check to critical caches:
builder.Services.AddHealthChecks().AddRefreshAheadMemoryCaches(
cacheNames: ["PriceCache", "ReferenceDataCache"],
name: "critical-caches",
tags: ["ready"]);
Or configure a maximum age for the last successful refresh:
builder.Services.AddHealthChecks().AddRefreshAheadMemoryCaches(
maxAge: TimeSpan.FromMinutes(10));
See the main package documentation for details.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.0)
- RefreshAhead.MemoryCache (>= 1.1.2)
-
net8.0
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.0)
- RefreshAhead.MemoryCache (>= 1.1.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.