using System;
using System.Collections.Generic;

namespace ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Host.Backend.Historian
{
    /// <summary>
    ///     Point-in-time runtime health of the historian subsystem — consumed by the status dashboard
    ///     via an IPC health query (not wired in PR #5; deferred).
    /// </summary>
    public sealed class HistorianHealthSnapshot
    {
        public long TotalQueries { get; set; }
        public long TotalSuccesses { get; set; }
        public long TotalFailures { get; set; }
        public int ConsecutiveFailures { get; set; }
        public DateTime? LastSuccessTime { get; set; }
        public DateTime? LastFailureTime { get; set; }
        public string? LastError { get; set; }
        public bool ProcessConnectionOpen { get; set; }
        public bool EventConnectionOpen { get; set; }
        public string? ActiveProcessNode { get; set; }
        public string? ActiveEventNode { get; set; }
        public int NodeCount { get; set; }
        public int HealthyNodeCount { get; set; }
        public List<HistorianClusterNodeState> Nodes { get; set; } = new();
    }
}
