Table of Contents

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

Name string

The friendly name of the monitored application.

ProcessId int?

The OS process ID, or null if no process is currently tracked.

IsRunning bool

Whether the monitored process is currently alive.

RestartAttempts int

The number of restart attempts in the current failure cycle.

MaxRestartAttempts int

The configured maximum restart attempts before giving up.

MaxRestartsReached bool

Whether the monitor has exhausted all restart attempts.

HasCompletedInitialCheck bool

Whether the monitor has completed its initial health check delay.

ConsecutivePortFailures int

The number of consecutive port check failures in the current cycle.

ConsecutiveResourceFailures int

The 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

int

ConsecutiveResourceFailures

The number of consecutive CPU/memory check failures in the current cycle.

public int ConsecutiveResourceFailures { get; init; }

Property Value

int

HasCompletedInitialCheck

Whether the monitor has completed its initial health check delay.

public bool HasCompletedInitialCheck { get; init; }

Property Value

bool

IsRunning

Whether the monitored process is currently alive.

public bool IsRunning { get; init; }

Property Value

bool

MaxRestartAttempts

The configured maximum restart attempts before giving up.

public int MaxRestartAttempts { get; init; }

Property Value

int

MaxRestartsReached

Whether the monitor has exhausted all restart attempts.

public bool MaxRestartsReached { get; init; }

Property Value

bool

Name

The friendly name of the monitored application.

public string Name { get; init; }

Property Value

string

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

int

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; }

Property Value

string