mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-23 19:57:09 +00:00
e09fe06201
The critical (severity-escalation) threshold was hardcoded as Trigger + 10 for all metric types. For percentage metrics (cpu, memory, disk, usage) with high triggers, this made critical escalation unreachable: a CPU trigger of 95% produced a critical threshold of 105%, which is impossible for a 0-100% metric. Fix: add computeCriticalThreshold() helper that caps the critical threshold at 99 for percentage metrics. Non-percentage metrics (temperature, diskRead, diskWrite, networkIn, networkOut) keep the Trigger + 10 offset unchanged. Applied to all three code paths that derive critical from trigger: - buildCanonicalMetricSpec (canonical evaluation) - checkMetric new alert creation (legacy path) - checkMetric existing alert update (legacy path)