mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-25 12:59:06 +01:00
commit
f534ad66e1
@ -7,7 +7,7 @@
|
|||||||
export let metricsInHistograms
|
export let metricsInHistograms
|
||||||
export let isOpen
|
export let isOpen
|
||||||
|
|
||||||
let availableMetrics = ['cpu_load', 'flops_any', 'mem_used', 'mem_bw', 'net_bw', 'file_bw']
|
let availableMetrics = ['cpu_load', 'flops_any', 'mem_used', 'mem_bw'] // 'net_bw', 'file_bw'
|
||||||
let pendingMetrics = [...metricsInHistograms] // Copy
|
let pendingMetrics = [...metricsInHistograms] // Copy
|
||||||
const client = getContextClient()
|
const client = getContextClient()
|
||||||
|
|
||||||
|
@ -43,8 +43,10 @@
|
|||||||
} else if (jm?.metric?.series?.length > 1) {
|
} else if (jm?.metric?.series?.length > 1) {
|
||||||
const avgs = jm.metric.series.map(jms => jms.statistics.avg)
|
const avgs = jm.metric.series.map(jms => jms.statistics.avg)
|
||||||
mv = round(mean(avgs), 2)
|
mv = round(mean(avgs), 2)
|
||||||
|
} else if (jm?.metric?.series) {
|
||||||
|
mv = round(jm.metric.series[0].statistics.avg, 2)
|
||||||
} else {
|
} else {
|
||||||
mv = jm.metric.series[0].statistics.avg
|
mv = 0.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,12 +113,12 @@
|
|||||||
else return (mean <= thresholds.peak && mean > thresholds.normal)
|
else return (mean <= thresholds.peak && mean > thresholds.normal)
|
||||||
case 'alert':
|
case 'alert':
|
||||||
if (metric === 'mem_used') return (mean <= thresholds.alert && mean > thresholds.caution)
|
if (metric === 'mem_used') return (mean <= thresholds.alert && mean > thresholds.caution)
|
||||||
else return (mean <= thresholds.alert && mean > 0)
|
else return (mean <= thresholds.alert && mean >= 0)
|
||||||
case 'caution':
|
case 'caution':
|
||||||
if (metric === 'mem_used') return (mean <= thresholds.caution && mean > thresholds.normal)
|
if (metric === 'mem_used') return (mean <= thresholds.caution && mean > thresholds.normal)
|
||||||
else return (mean <= thresholds.caution && mean > thresholds.alert)
|
else return (mean <= thresholds.caution && mean > thresholds.alert)
|
||||||
case 'normal':
|
case 'normal':
|
||||||
if (metric === 'mem_used') return (mean <= thresholds.normal && mean > 0)
|
if (metric === 'mem_used') return (mean <= thresholds.normal && mean >= 0)
|
||||||
else return (mean <= thresholds.normal && mean > thresholds.caution)
|
else return (mean <= thresholds.normal && mean > thresholds.caution)
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user