mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-21 15:46:43 +00:00
fix: harden MonitorService evaluation loop (#942)
- Change network metrics (net_rx/net_tx) from cumulative totals to MB/s rates so alert thresholds are operationally meaningful - Wrap all external calls (Docker stats, systeminformation, docker df) in 10-second timeout via Promise.race to prevent hung operations from blocking the evaluation loop indefinitely - Parallelize host CPU/RAM/disk queries with Promise.all to bound worst-case latency at 10 seconds instead of 30 - Use epsilon comparison for == operator so floating-point metric values can match integer thresholds - Clean up stale entries in activeBreaches and previousNetworkStats maps after rules are deleted or containers stop - Add standard INFO logging for alert firings and WARN logging for slow cycles and timeouts; add diagnostic cycle timing and breach-count log
This commit is contained in:
@@ -54,8 +54,8 @@ const metricOptions = [
|
||||
{ value: 'cpu_percent', label: 'CPU Usage (%)' },
|
||||
{ value: 'memory_percent', label: 'Memory Usage (%)' },
|
||||
{ value: 'memory_mb', label: 'Memory Usage (MB)' },
|
||||
{ value: 'net_rx', label: 'Network In (MB)' },
|
||||
{ value: 'net_tx', label: 'Network Out (MB)' },
|
||||
{ value: 'net_rx', label: 'Network In (MB/s)' },
|
||||
{ value: 'net_tx', label: 'Network Out (MB/s)' },
|
||||
{ value: 'restart_count', label: 'Restart Count' },
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user