using ZB.MOM.WW.ScadaBridge.AuditLog.Payload; namespace ZB.MOM.WW.ScadaBridge.AuditLog.Central; /// /// Read-side surface exposing the central-side /// audit-health counters: (every /// repository insert throw from / /// ), /// (every payload-filter redactor throw on the central path), and /// (per-site latched state from the /// ). /// /// /// /// Read-only contract. Implementations expose a point-in-time snapshot /// — increments and tracker updates happen through the dedicated counter / /// tracker interfaces, not through this surface. Consumers (central /// health pages) read these properties; they never mutate. /// /// /// Why a parallel surface from . /// aggregates per-site /// SiteHealthState reports the SITE emits. The central audit-write /// failure / redaction-failure counters originate ON central (no site report /// carries them), so they live on a dedicated snapshot rather than being /// retro-fitted into a per-site state. The two surfaces will be composed at /// the dashboard layer. /// /// public interface IAuditCentralHealthSnapshot { /// /// Count of central-side audit-write failures since process start. /// Incremented by every / /// repository insert that throws. /// int CentralAuditWriteFailures { get; } /// /// Count of central-side payload-filter redactor over-redactions since /// process start. Incremented by every header / body / SQL-parameter /// redactor stage that throws (the filter falls back to the /// <redacted: redactor error> marker and never aborts the /// user-facing action). Sites have their own counter /// (-backed /// SiteHealthReport.AuditRedactionFailure) and the central /// composition root's binding routes ALL central redactor throws /// (CentralAuditWriter + AuditLogIngestActor paths) into this counter. /// int AuditRedactionFailure { get; } /// /// Count of inbound request/response body truncations at the /// /// ceiling since process start. Incremented by /// /// whenever either the request or response body exceeds the cap and is /// truncated in the audit copy. A sustained non-zero count can indicate /// callers sending unexpectedly large bodies. /// int AuditInboundCeilingHits { get; } /// /// Per-site latched stalled state: true when the /// has observed two /// consecutive non-draining cycles for that site, false after the /// first draining cycle. Sites absent from the map are interpreted as /// healthy (Stalled=false default). Snapshot is a defensive /// copy — readers must not mutate. /// IReadOnlyDictionary SiteAuditTelemetryStalled { get; } }