Class TransportHealthMetrics
Metrics for transport health monitoring.
public sealed class TransportHealthMetrics
- Inheritance
-
TransportHealthMetrics
- Inherited Members
- Extension Methods
Constructors
TransportHealthMetrics(DateTimeOffset, TransportHealthStatus, int, long, double, TimeSpan, IReadOnlyDictionary<string, object>?)
Initializes a new instance of the TransportHealthMetrics class.
public TransportHealthMetrics(DateTimeOffset lastCheckTimestamp, TransportHealthStatus lastStatus, int consecutiveFailures, long totalChecks, double successRate, TimeSpan averageCheckDuration, IReadOnlyDictionary<string, object>? customMetrics = null)
Parameters
lastCheckTimestampDateTimeOffsetTimestamp of the last health check.
lastStatusTransportHealthStatusThe last health status.
consecutiveFailuresintNumber of consecutive failures.
totalCheckslongTotal number of health checks performed.
successRatedoubleSuccess rate of health checks (0.0 to 1.0).
averageCheckDurationTimeSpanAverage duration of health checks.
customMetricsIReadOnlyDictionary<string, object>Custom metrics dictionary.
Properties
AverageCheckDuration
Gets the average duration of health checks.
public TimeSpan AverageCheckDuration { get; }
Property Value
ConsecutiveFailures
Gets the number of consecutive failures.
public int ConsecutiveFailures { get; }
Property Value
CustomMetrics
Gets custom metrics.
public IReadOnlyDictionary<string, object> CustomMetrics { get; }
Property Value
IsHealthy
Gets a value indicating whether the component is healthy.
public bool IsHealthy { get; }
Property Value
IsStable
Gets a value indicating whether the component is stable (no recent failures and high success rate).
public bool IsStable { get; }
Property Value
LastCheckTimestamp
Gets the timestamp of the last health check.
public DateTimeOffset LastCheckTimestamp { get; }
Property Value
LastStatus
Gets the last health status.
public TransportHealthStatus LastStatus { get; }
Property Value
SuccessRate
Gets the success rate of health checks (0.0 to 1.0).
public double SuccessRate { get; }
Property Value
TotalChecks
Gets the total number of health checks performed.
public long TotalChecks { get; }