mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-01-26 03:19:06 +01:00
commit
817efde844
@ -50,7 +50,13 @@
|
|||||||
...(ccconfig[`job_view_polarPlotMetrics:${job.cluster}`] || ccconfig[`job_view_polarPlotMetrics`]),
|
...(ccconfig[`job_view_polarPlotMetrics:${job.cluster}`] || ccconfig[`job_view_polarPlotMetrics`]),
|
||||||
...(ccconfig[`job_view_nodestats_selectedMetrics:${job.cluster}`] || ccconfig[`job_view_nodestats_selectedMetrics`])])
|
...(ccconfig[`job_view_nodestats_selectedMetrics:${job.cluster}`] || ccconfig[`job_view_nodestats_selectedMetrics`])])
|
||||||
|
|
||||||
startFetching(job, [...toFetch], job.numNodes > 2 ? ["node"] : ["node", "core"])
|
// Select default Scopes to load
|
||||||
|
if (job.numAcc === 0) { // No Accels
|
||||||
|
startFetching(job, [...toFetch], job.numNodes > 2 ? ["node"] : ["node", "core"])
|
||||||
|
} else { // Accels
|
||||||
|
startFetching(job, [...toFetch], job.numNodes > 2 ? ["node", "accelerator"] : ["node", "accelerator", "core"])
|
||||||
|
}
|
||||||
|
|
||||||
isFetched = toFetch
|
isFetched = toFetch
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -55,14 +55,18 @@
|
|||||||
|
|
||||||
let metricUnits = {}
|
let metricUnits = {}
|
||||||
$: if ($nodesQuery.data) {
|
$: if ($nodesQuery.data) {
|
||||||
for (let metric of clusters.find(c => c.name == cluster).metricConfig) {
|
let thisCluster = clusters.find(c => c.name == cluster)
|
||||||
if (metric.unit.prefix || metric.unit.base) {
|
if (thisCluster) {
|
||||||
metricUnits[metric.name] = '(' + (metric.unit.prefix ? metric.unit.prefix : '') + (metric.unit.base ? metric.unit.base : '') + ')'
|
for (let metric of thisCluster.metricConfig) {
|
||||||
} else { // If no unit defined: Omit Unit Display
|
if (metric.unit.prefix || metric.unit.base) {
|
||||||
metricUnits[metric.name] = ''
|
metricUnits[metric.name] = '(' + (metric.unit.prefix ? metric.unit.prefix : '') + (metric.unit.base ? metric.unit.base : '') + ')'
|
||||||
|
} else { // If no unit defined: Omit Unit Display
|
||||||
|
metricUnits[metric.name] = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// $: console.log($nodesQuery?.data?.nodeMetrics[0].metrics)
|
// $: console.log($nodesQuery?.data?.nodeMetrics[0].metrics)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -98,7 +102,7 @@
|
|||||||
let:width
|
let:width
|
||||||
itemsPerRow={ccconfig.plot_view_plotsPerRow}
|
itemsPerRow={ccconfig.plot_view_plotsPerRow}
|
||||||
items={$nodesQuery.data.nodeMetrics[0].metrics.sort((a, b) => a.name.localeCompare(b.name))}>
|
items={$nodesQuery.data.nodeMetrics[0].metrics.sort((a, b) => a.name.localeCompare(b.name))}>
|
||||||
<h4 style="text-align: center;">{item.name} {metricUnits[item.name]}</h4>
|
<h4 style="text-align: center; padding-top:15px;">{item.name} {metricUnits[item.name]}</h4>
|
||||||
<MetricPlot
|
<MetricPlot
|
||||||
width={width} height={300} metric={item.name} timestep={item.metric.timestep}
|
width={width} height={300} metric={item.name} timestep={item.metric.timestep}
|
||||||
cluster={clusters.find(c => c.name == cluster)} subCluster={$nodesQuery.data.nodeMetrics[0].subCluster}
|
cluster={clusters.find(c => c.name == cluster)} subCluster={$nodesQuery.data.nodeMetrics[0].subCluster}
|
||||||
|
@ -59,11 +59,13 @@
|
|||||||
let metricUnits = {}
|
let metricUnits = {}
|
||||||
$: if ($nodesQuery.data) {
|
$: if ($nodesQuery.data) {
|
||||||
let thisCluster = clusters.find(c => c.name == cluster)
|
let thisCluster = clusters.find(c => c.name == cluster)
|
||||||
for (let metric of thisCluster.metricConfig) {
|
if (thisCluster) {
|
||||||
if (metric.unit.prefix || metric.unit.base) {
|
for (let metric of thisCluster.metricConfig) {
|
||||||
metricUnits[metric.name] = '(' + (metric.unit.prefix ? metric.unit.prefix : '') + (metric.unit.base ? metric.unit.base : '') + ')'
|
if (metric.unit.prefix || metric.unit.base) {
|
||||||
} else { // If no unit defined: Omit Unit Display
|
metricUnits[metric.name] = '(' + (metric.unit.prefix ? metric.unit.prefix : '') + (metric.unit.base ? metric.unit.base : '') + ')'
|
||||||
metricUnits[metric.name] = ''
|
} else { // If no unit defined: Omit Unit Display
|
||||||
|
metricUnits[metric.name] = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,7 +131,7 @@
|
|||||||
})
|
})
|
||||||
.sort((a, b) => a.host.localeCompare(b.host))}>
|
.sort((a, b) => a.host.localeCompare(b.host))}>
|
||||||
|
|
||||||
<h4 style="width: 100%; text-align: center;"><a href="/monitoring/node/{cluster}/{item.host}">{item.host} ({item.subCluster})</a></h4>
|
<h4 style="width: 100%; text-align: center;"><a style="display: block;padding-top: 15px;" href="/monitoring/node/{cluster}/{item.host}">{item.host} ({item.subCluster})</a></h4>
|
||||||
{#if item.removed == false && item.data != null}
|
{#if item.removed == false && item.data != null}
|
||||||
<MetricPlot
|
<MetricPlot
|
||||||
width={width}
|
width={width}
|
||||||
|
@ -265,14 +265,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function findThresholds(metricConfig, scope, subCluster) {
|
export function findThresholds(metricConfig, scope, subCluster) {
|
||||||
if (!metricConfig || !scope || !subCluster)
|
if (!metricConfig || !scope || !subCluster) {
|
||||||
|
console.warn('Argument missing for findThresholds!')
|
||||||
return null
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
if (scope == 'node' || metricConfig.aggregation == 'avg') {
|
if (scope == 'node' || metricConfig.aggregation == 'avg') {
|
||||||
if (!metricConfig.subClusters)
|
if (metricConfig.subClusters && metricConfig.subClusters.length === 0) {
|
||||||
|
// console.log('subClusterConfigs array empty, use metricConfig defaults')
|
||||||
return { normal: metricConfig.normal, caution: metricConfig.caution, alert: metricConfig.alert }
|
return { normal: metricConfig.normal, caution: metricConfig.caution, alert: metricConfig.alert }
|
||||||
else
|
} else if (metricConfig.subClusters && metricConfig.subClusters.length > 0) {
|
||||||
|
// console.log('subClusterConfigs found, find and use subCluster Settings')
|
||||||
return metricConfig.subClusters.find(sc => sc.name == subCluster.name)
|
return metricConfig.subClusters.find(sc => sc.name == subCluster.name)
|
||||||
|
} else {
|
||||||
|
console.warn('metricConfig.subClusters not found!')
|
||||||
|
return null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (metricConfig.aggregation != 'sum') {
|
if (metricConfig.aggregation != 'sum') {
|
||||||
|
Loading…
Reference in New Issue
Block a user