7b0b9c7365
Solution + 23 src projects + 26 test projects renamed; folders, csproj, namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated. ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated. SQL roles/logins, LDAP domains, CLI command name, and CLI config dir (~/.scadalink → ~/.scadabridge) also renamed. Build green; 5 Host.Tests fail awaiting SQL login rename in next commit. Pre-existing StaleTagMonitor timing flakes unchanged. Rename script committed at tools/rename-to-scadabridge.sh.
61 lines
2.7 KiB
C#
61 lines
2.7 KiB
C#
namespace ZB.MOM.WW.ScadaBridge.AuditLog.Central;
|
|
|
|
/// <summary>
|
|
/// Tuning knobs for the central <see cref="SiteAuditReconciliationActor"/> singleton.
|
|
/// Defaults mirror the M6 Bundle B brief: pull every 5 minutes per site, 256 rows per
|
|
/// batch, declare a site "stalled" after two consecutive pull cycles return non-empty
|
|
/// AND <c>MoreAvailable=true</c> (the backlog is not draining).
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Per the M6 plan the reconciliation actor is the fallback when push telemetry is
|
|
/// lost; it is intentionally low-frequency. Lowering
|
|
/// <see cref="ReconciliationIntervalSeconds"/> in production trades MS SQL load for
|
|
/// fresher self-healing — keep the default unless a deployment can prove the extra
|
|
/// load is acceptable.
|
|
/// </para>
|
|
/// <para>
|
|
/// <see cref="StalledAfterNonDrainingCycles"/> = 2 because a single non-draining
|
|
/// cycle can happen on a surge (e.g. a backed-up site replays its hot queue); the
|
|
/// stalled signal should only fire when the backlog persists across cycles, which is
|
|
/// the symptom the central health surface is asking us to detect.
|
|
/// </para>
|
|
/// </remarks>
|
|
public sealed class SiteAuditReconciliationOptions
|
|
{
|
|
/// <summary>
|
|
/// Period of the reconciliation tick. Each tick visits every known site once.
|
|
/// </summary>
|
|
public int ReconciliationIntervalSeconds { get; set; } = 300;
|
|
|
|
/// <summary>
|
|
/// Test-only override for finer control over the tick cadence than
|
|
/// whole-second resolution allows. When non-null, takes precedence over
|
|
/// <see cref="ReconciliationIntervalSeconds"/>. Not bound from config —
|
|
/// production config exposes <see cref="ReconciliationIntervalSeconds"/>
|
|
/// only.
|
|
/// </summary>
|
|
public TimeSpan? ReconciliationIntervalOverride { get; set; }
|
|
|
|
/// <summary>
|
|
/// Resolves the effective tick interval, honouring the test override when
|
|
/// set. Falls back to <see cref="ReconciliationIntervalSeconds"/>.
|
|
/// </summary>
|
|
public TimeSpan ReconciliationInterval =>
|
|
ReconciliationIntervalOverride ?? TimeSpan.FromSeconds(ReconciliationIntervalSeconds);
|
|
|
|
/// <summary>
|
|
/// Maximum number of <see cref="ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit.AuditEvent"/>
|
|
/// rows requested in a single <c>PullAuditEvents</c> RPC call.
|
|
/// </summary>
|
|
public int BatchSize { get; set; } = 256;
|
|
|
|
/// <summary>
|
|
/// Number of consecutive non-draining cycles (events returned AND
|
|
/// <c>MoreAvailable=true</c>) that must accumulate for a site before the actor
|
|
/// publishes <c>SiteAuditTelemetryStalledChanged(Stalled: true)</c> on the
|
|
/// EventStream.
|
|
/// </summary>
|
|
public int StalledAfterNonDrainingCycles { get; set; } = 2;
|
|
}
|