You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
触发规则实时监控:规则引擎在内存保留最近 100 次已结束的触发(成功/离线/超时/读失败/推送失败/丢弃),新增只读 GET /triggerRule/recentTriggers(可按规则过滤,镜像到 /agentApi);控制台「事件触发规则」页新增实时监控抽屉,展示触发时间、规则、状态、目标通道、动作设备、耗时与错误,展开可看本次实际读到的点位值,打开期间每 3 秒刷新。仅内存、重启即清空;持久化历史与条件快照仍走触发历史页。
Added
OPC UA channel monitoring: the server channel keeps its recent
address-space batches; publishCount / rowsCount now mean update batches /
updated points, extra exposes point coverage, subscription and
monitored-item counts plus rebuild count, and Connected means the listener
is up.
Event-triggered collection rules: adds rule management and trigger history
(migration 033_trigger_rule.sql). Conditions are DNF (OR across groups, AND
within a group) with optional cooldown and read timeout; on a rising edge in
collected samples the engine asynchronously reads the action device's points
and pushes them to one channel, recording success / offline / timeout / read_failed / push_failed / dropped with rule, condition and result
snapshots (7 days or 20,000 rows). The console gains Event Trigger Rules and
Trigger History pages; routes are mirrored to /agentApi and error codes 40051–40062 are added.
Trigger-rule read timeout: device-lock acquisition is now
context-aware. When a slow poll or reconnect owns the device, a rule read
gives up waiting at its timeout (default 5s, max 60s) and records the new timeout status; a read that was already in flight and finishes late is no
longer pushed. Control writes also give up waiting on the caller's ctx.
Per-device trigger execution: the rule engine now hands reads and pushes
to a serial executor per action device; global dispatch goroutines no longer
perform I/O. A slow device only occupies its own queue, while rules for other
devices keep running. The same device remains strictly serial; a full
per-device queue records dropped and clears the rule's single-flight flag.
Trigger rule code: trigger_rule gains a globally unique business code code (migration 034_trigger_rule_code.sql), required on creation,
immutable afterwards, using the same format as device and collector-group
codes; existing rows are backfilled from their IDs. Event payload trigger
objects gain ruleCode, trigger history stores a rule_code snapshot, and
the rule list can be searched by code.
Trigger metadata in event payloads: action records pushed by a trigger
rule carry an optional trigger object (source / ruleId / ruleCode / ruleName / triggerId / firedAt, where firedAt is the rising-edge
time). Only event pushes include it, so normal collection and
external-subscription payloads stay byte-for-byte unchanged; offline spool
replay preserves the metadata. native-json and group-json expose it directly,
while mapping-json and script can opt in by referencing trigger.*.
Live trigger-rule monitoring: the rule engine keeps the last 100 completed
triggers in memory (success / offline / timeout / read failed / push failed / dropped)
behind the read-only GET /triggerRule/recentTriggers (optional rule filter,
mirrored to /agentApi). The Event Trigger Rules page gains a live monitor
drawer showing fired time, rule, status, target channel, action device,
duration and error; expanding a row shows the point values actually read,
refreshing every 3 seconds while open. Memory-only — cleared on restart;
persisted history and condition snapshots remain on the Trigger History page.