using System;
namespace ZB.MOM.WW.OtOpcUa.Host.Historian
{
///
/// Point-in-time state of a single historian cluster node. One entry per configured node is
/// surfaced inside so the status dashboard can render
/// per-node health and operators can see which nodes are in cooldown.
///
public sealed class HistorianClusterNodeState
{
///
/// Gets or sets the configured node hostname exactly as it appears in
/// HistorianConfiguration.ServerNames.
///
public string Name { get; set; } = "";
///
/// Gets or sets a value indicating whether the node is currently eligible for new connection
/// attempts. means the node is in its post-failure cooldown window
/// and the picker is skipping it.
///
public bool IsHealthy { get; set; }
///
/// Gets or sets the UTC timestamp at which the node's cooldown expires, or
/// when the node is not in cooldown.
///
public DateTime? CooldownUntil { get; set; }
///
/// Gets or sets the number of times this node has transitioned from healthy to failed
/// since startup. Does not decrement on recovery.
///
public int FailureCount { get; set; }
///
/// Gets or sets the message from the most recent failure, or when
/// the node has never failed.
///
public string? LastError { get; set; }
///
/// Gets or sets the UTC timestamp of the most recent failure, or
/// when the node has never failed.
///
public DateTime? LastFailureTime { get; set; }
}
}