mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 05:19:05 +01:00
Match mem_used color logic for footprint with plots
This commit is contained in:
parent
2d8cf02296
commit
53af79cf0d
@ -106,19 +106,19 @@
|
||||
})
|
||||
|
||||
function evalFootprint(metric, mean, thresholds, level) {
|
||||
// mem_used has inverse logic regarding threshold levels
|
||||
// mem_used has inverse logic regarding threshold levels, notify levels triggered if mean > threshold
|
||||
switch (level) {
|
||||
case 'peak':
|
||||
if (metric === 'mem_used') return (mean <= thresholds.peak && mean > thresholds.alert)
|
||||
if (metric === 'mem_used') return false // mem_used over peak -> return false to trigger impact -1
|
||||
else return (mean <= thresholds.peak && mean > thresholds.normal)
|
||||
case 'alert':
|
||||
if (metric === 'mem_used') return (mean <= thresholds.alert && mean > thresholds.caution)
|
||||
if (metric === 'mem_used') return (mean <= thresholds.peak && mean >= thresholds.alert)
|
||||
else return (mean <= thresholds.alert && mean >= 0)
|
||||
case 'caution':
|
||||
if (metric === 'mem_used') return (mean <= thresholds.caution && mean > thresholds.normal)
|
||||
if (metric === 'mem_used') return (mean < thresholds.alert && mean >= thresholds.caution)
|
||||
else return (mean <= thresholds.caution && mean > thresholds.alert)
|
||||
case 'normal':
|
||||
if (metric === 'mem_used') return (mean <= thresholds.normal && mean >= 0)
|
||||
if (metric === 'mem_used') return (mean < thresholds.caution && mean >= 0)
|
||||
else return (mean <= thresholds.normal && mean > thresholds.caution)
|
||||
default:
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user