using ScadaLink.Commons.Messages.Health;
using ScadaLink.Commons.Types;
using ScadaLink.Commons.Types.Enums;
namespace ScadaLink.HealthMonitoring;
///
/// Interface for site-side health metric collection.
/// Consumed by Site Runtime actors to report errors, and by DCL to report connection health.
///
public interface ISiteHealthCollector
{
void IncrementScriptError();
void IncrementAlarmError();
void IncrementDeadLetter();
///
/// Audit Log (#23) Bundle G — increment the per-interval count of
/// FallbackAuditWriter primary failures. Bridged from the
/// IAuditWriteFailureCounter binding registered via
/// AddAuditLogHealthMetricsBridge().
///
void IncrementSiteAuditWriteFailures();
///
/// Audit Log (#23) M5 Bundle C — increment the per-interval count of
/// payload-filter redactor over-redactions (header / body / SQL
/// parameter stage throws routed to the
/// <redacted: redactor error> marker). Bridged from the
/// IAuditRedactionFailureCounter binding registered via
/// AddAuditLogHealthMetricsBridge().
///
void IncrementAuditRedactionFailure();
///
/// Audit Log (#23) M6 Bundle E (T6) — replace the latest site-local
/// audit-queue backlog snapshot (pending count, oldest pending row,
/// on-disk file bytes) used by the next call.
/// Refreshed periodically by the SiteAuditBacklogReporter hosted
/// service so each report carries a recent point-in-time view of the
/// site→central drain health.
///
void UpdateSiteAuditBacklog(SiteAuditBacklogSnapshot snapshot);
void UpdateConnectionHealth(string connectionName, ConnectionHealth health);
void RemoveConnection(string connectionName);
void UpdateTagResolution(string connectionName, int totalSubscribed, int successfullyResolved);
void UpdateConnectionEndpoint(string connectionName, string endpoint);
void UpdateTagQuality(string connectionName, int good, int bad, int uncertain);
void SetStoreAndForwardDepths(IReadOnlyDictionary depths);
void SetInstanceCounts(int deployed, int enabled, int disabled);
void SetParkedMessageCount(int count);
void SetNodeHostname(string hostname);
void SetClusterNodes(IReadOnlyList nodes);
void SetActiveNode(bool isActive);
bool IsActiveNode { get; }
SiteHealthReport CollectReport(string siteId);
}