Class HealthMonitorStatus
- Namespace
- AppHealthMonitor
- Assembly
- AppHealthMonitor.dll
Immutable snapshot of a HealthMonitor's current state for diagnostics.
public sealed record HealthMonitorStatus : IEquatable<HealthMonitorStatus>
- Inheritance
-
HealthMonitorStatus
- Implements
- Inherited Members
Constructors
HealthMonitorStatus(string, int?, bool, int, int, bool, bool, int, int)
Immutable snapshot of a HealthMonitor's current state for diagnostics.
public HealthMonitorStatus(string Name, int? ProcessId, bool IsRunning, int RestartAttempts, int MaxRestartAttempts, bool MaxRestartsReached, bool HasCompletedInitialCheck, int ConsecutivePortFailures, int ConsecutiveResourceFailures)
Parameters
NamestringThe friendly name of the monitored application.
ProcessIdint?The OS process ID, or null if no process is currently tracked.
IsRunningboolWhether the monitored process is currently alive.
RestartAttemptsintThe number of restart attempts in the current failure cycle.
MaxRestartAttemptsintThe configured maximum restart attempts before giving up.
MaxRestartsReachedboolWhether the monitor has exhausted all restart attempts.
HasCompletedInitialCheckboolWhether the monitor has completed its initial health check delay.
ConsecutivePortFailuresintThe number of consecutive port check failures in the current cycle.
ConsecutiveResourceFailuresintThe number of consecutive CPU/memory check failures in the current cycle.
Properties
ConsecutivePortFailures
The number of consecutive port check failures in the current cycle.
public int ConsecutivePortFailures { get; init; }
Property Value
ConsecutiveResourceFailures
The number of consecutive CPU/memory check failures in the current cycle.
public int ConsecutiveResourceFailures { get; init; }
Property Value
HasCompletedInitialCheck
Whether the monitor has completed its initial health check delay.
public bool HasCompletedInitialCheck { get; init; }
Property Value
IsRunning
Whether the monitored process is currently alive.
public bool IsRunning { get; init; }
Property Value
MaxRestartAttempts
The configured maximum restart attempts before giving up.
public int MaxRestartAttempts { get; init; }
Property Value
MaxRestartsReached
Whether the monitor has exhausted all restart attempts.
public bool MaxRestartsReached { get; init; }
Property Value
Name
The friendly name of the monitored application.
public string Name { get; init; }
Property Value
ProcessId
The OS process ID, or null if no process is currently tracked.
public int? ProcessId { get; init; }
Property Value
- int?
RestartAttempts
The number of restart attempts in the current failure cycle.
public int RestartAttempts { get; init; }
Property Value
StateLabel
Gets a human-readable state label derived from the current monitor status. Returns "EXHAUSTED" when all restart attempts are used, "DOWN" when the process is not running, "STARTING" while the process is running but still in initial delay, and "HEALTHY" otherwise.
public string StateLabel { get; }