295150751f
The Test Run sandbox and Monaco analysis modelled a script API that had drifted from the site runtime's ScriptGlobals, so real scripts failed to compile in Test Run. Realign both to the runtime surface (Instance/Scripts/ExternalSystem/Attributes/Children/Parent) and drop the duplicate ScriptHost stub so the two cannot diverge again. - Script calls (Scripts.CallShared, Instance.CallScript, Route.To().Call) accept an anonymous object instead of a hand-built dictionary, via a shared ScriptArgs normalizer; existing dictionary calls still compile. - Test Run can optionally bind to a deployed instance, so Instance/ Attributes/CallScript route to it cross-site; adds site-side RouteToGetAttributes/RouteToSetAttributes handlers. - Adds Test Run panels to the API method and template script editors. - Fixes the TestDatabaseQuery seed script, which queried a table that never existed. Also commits unrelated in-progress work already in the tree: the health monitoring report loop, site streaming changes, and the Admin/Design data-connection and SMTP page reorganization.
30 lines
1.0 KiB
C#
30 lines
1.0 KiB
C#
using ScadaLink.Commons.Messages.Health;
|
|
|
|
namespace ScadaLink.HealthMonitoring;
|
|
|
|
/// <summary>
|
|
/// In-memory state for a single site's health, stored by the central aggregator.
|
|
/// </summary>
|
|
public class SiteHealthState
|
|
{
|
|
public required string SiteId { get; init; }
|
|
public SiteHealthReport LatestReport { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Time the latest full <see cref="SiteHealthReport"/> was processed.
|
|
/// Used by the UI to surface report staleness during failover.
|
|
/// </summary>
|
|
public DateTimeOffset LastReportReceivedAt { get; set; }
|
|
|
|
/// <summary>
|
|
/// Time the most recent signal of any kind (full report OR ~5s heartbeat)
|
|
/// was received. Drives offline detection — heartbeats from the standby
|
|
/// keep the site marked online even when the active node is unable to
|
|
/// produce a report (mid-failover, brief stalls).
|
|
/// </summary>
|
|
public DateTimeOffset LastHeartbeatAt { get; set; }
|
|
|
|
public long LastSequenceNumber { get; set; }
|
|
public bool IsOnline { get; set; }
|
|
}
|