Struct HealthCheckResult
- Namespace
- Acuit.Pinpoint.HealthChecks
- Assembly
- Acuit.Pinpoint.HealthChecks.dll
Represents the result of a health check.
public readonly struct HealthCheckResult
- Inherited Members
Constructors
HealthCheckResult(HealthStatus, string, Exception)
Creates a new HealthCheckResult with the specified values for status
,
exception
, and description
.
public HealthCheckResult(HealthStatus status, string description = null, Exception exception = null)
Parameters
status
HealthStatusA value indicating the status of the component that was checked.
description
stringA human-readable description of the status of the component that was checked.
exception
ExceptionAn Exception representing the exception that was thrown when checking for status (if any).
Properties
Description
Gets a human-readable description of the status of the component that was checked.
public string Description { get; }
Property Value
Exception
Gets an Exception representing the exception that was thrown when checking for status (if any).
public Exception Exception { get; }
Property Value
Status
Gets a value indicating the status of the component that was checked.
public HealthStatus Status { get; }
Property Value
Methods
Degraded(string, Exception)
Creates a HealthCheckResult representing a degraded component.
public static HealthCheckResult Degraded(string description = null, Exception exception = null)
Parameters
description
stringA human-readable description of the status of the component that was checked. Optional.
exception
ExceptionAn Exception representing the exception that was thrown when checking for status. Optional.
Returns
- HealthCheckResult
A HealthCheckResult representing a degraged component.
Healthy(string)
Creates a HealthCheckResult representing a healthy component.
public static HealthCheckResult Healthy(string description = null)
Parameters
description
stringA human-readable description of the status of the component that was checked. Optional.
Returns
- HealthCheckResult
A HealthCheckResult representing a healthy component.
Unhealthy(string, Exception)
Creates a HealthCheckResult representing an unhealthy component.
public static HealthCheckResult Unhealthy(string description = null, Exception exception = null)
Parameters
description
stringA human-readable description of the status of the component that was checked. Optional.
exception
ExceptionAn Exception representing the exception that was thrown when checking for status. Optional.
Returns
- HealthCheckResult
A HealthCheckResult representing an unhealthy component.