Lyo.Health 1.0.0

dotnet add package Lyo.Health --version 1.0.0
                    
NuGet\Install-Package Lyo.Health -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lyo.Health" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lyo.Health" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Lyo.Health" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lyo.Health --version 1.0.0
                    
#r "nuget: Lyo.Health, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lyo.Health@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lyo.Health&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Lyo.Health&version=1.0.0
                    
Install as a Cake Tool

Lyo.Health

Interface for services that can report their health. Services implement IHealth and expose health directly—no central health service. Health returns HealthResult with status, timings, and optional metadata.

Examples

Usage

// File storage
var fileStorage = app.Services.GetRequiredService<IFileStorageService>();
var result = await fileStorage.CheckHealthAsync();
// result.IsHealthy, result.Duration, result.Metadata, result.Message

// Cache
var cache = app.Services.GetRequiredService<ICacheService>();
var result = await cache.CheckHealthAsync();

// RabbitMQ
var mq = app.Services.GetRequiredService<IMqService>();
var result = await mq.CheckHealthAsync();

Contract

public interface IHealth
{
    string HealthCheckName { get; }
    Task<HealthResult> CheckHealthAsync(CancellationToken ct = default);
}

HealthResult

HealthResult.Healthy(sw.Elapsed, message: null, metadata: new Dictionary<string, object?> { ["database"] = "audit" });
HealthResult.Unhealthy(sw.Elapsed, "Database connection failed", metadata: null, exception: ex);

Contract

  • HealthCheckName is a short identifier (e.g. "filestorage", "cache", "rabbitmq", "audit-postgres", "change-tracker-postgres") used to label probe output in hosts.
  • CheckHealthAsync is the live probe; it should be cheap, short-circuiting, and honor the supplied CancellationToken.

HealthResult

HealthResult is an immutable, sealed class that captures the outcome of a probe:

Member Type Notes
IsHealthy bool true for healthy, false for unhealthy.
Duration TimeSpan How long the probe took (typically measured with Stopwatch).
CheckedAt DateTime UTC instant the probe completed (set by the factory helpers).
Message string? Optional human-readable summary; populated with the exception message on failure.
Metadata IReadOnlyDictionary<string, object?>? Connection info, schema, version, key-id, etc.
Exception Exception? Captured exception when the probe threw.

Use the static factories rather than constructing directly:

Usage

Get health from the service directly: Service interfaces (IFileStorageService, ICacheService, IMqService) extend IHealth—health comes from the service, no separate registration. Hosts that need an aggregate view typically resolve IEnumerable<IHealth> and fan out CheckHealthAsync in parallel, then publish the resulting HealthResult collection.

Dependencies

Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).

  • Lyo.Exceptions — (direct, lyo)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (18)

Showing the top 5 NuGet packages that depend on Lyo.Health:

Package Downloads
Lyo.Cache

Cache service abstractions and local IMemoryCache implementation.

Lyo.MessageQueue

Message queue service interface and base implementation for asynchronous messaging.

Lyo.FileStorage

File storage service interface and base implementation for file operations.

Lyo.Job.Scheduler

Job scheduling and execution service dispatching jobs via RabbitMQ message queue.

Lyo.FileMetadataStore.Postgres

PostgreSQL implementation of the Lyo FileMetadataStore service using Entity Framework Core.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 148 8/16/2026