Class HealthStatus
- Namespace
- LMKit.Agents.Resilience
- Assembly
- LM-Kit.NET.dll
Represents the health status of an agent.
public sealed class HealthStatus
- Inheritance
-
HealthStatus
- Inherited Members
Examples
Reading the snapshot returned by a health check probe:
using LMKit.Agents.Resilience;
HealthStatus status = await agentHealthCheck.CheckAsync();
Console.WriteLine($"State: {status.Status} ({status.Message})");
Console.WriteLine($"Success rate: {status.SuccessRate:P1} over {status.SampleCount} samples");
Console.WriteLine($"Latency avg/max: {status.AverageLatency.TotalMilliseconds:F0} / " +
$"{status.MaxLatency.TotalMilliseconds:F0} ms");
Properties
- AverageLatency
Gets the average latency.
- CircuitState
Gets the circuit breaker state, if monitored.
- IsHealthy
Gets whether the agent is healthy.
- LastException
Gets the last exception, if any.
- MaxLatency
Gets the maximum latency.
- Message
Gets a human-readable status message.
- SampleCount
Gets the number of samples used.
- Status
Gets the overall health state.
- SuccessRate
Gets the success rate (0.0 to 1.0).