Skip to content

Commit

Permalink
Adapt normal marker line for shared jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
spacehamster87 committed Feb 16, 2024
1 parent e7ae9dd commit ec581e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions web/frontend/src/joblist/Row.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
subCluster={job.subCluster}
isShared={(job.exclusive != 1)}
resources={job.resources}
hwthreads={job.numHWThreads}
/>
{:else if metric.disabled == true && metric.data}
<Card body color="info">Metric disabled for subcluster <code>{metric.data.name}:{job.subCluster}</code></Card>
Expand Down
11 changes: 7 additions & 4 deletions web/frontend/src/plots/MetricPlot.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
export let subCluster
export let isShared = false
export let forNode = false
export let hwthreads = 0
if (useStatsSeries == null)
useStatsSeries = statisticsSeries != null
Expand All @@ -53,7 +54,7 @@
const lineWidth = clusterCockpitConfig.plot_general_lineWidth / window.devicePixelRatio
const lineColors = clusterCockpitConfig.plot_general_colorscheme
const backgroundColors = { normal: 'rgba(255, 255, 255, 1.0)', caution: 'rgba(255, 128, 0, 0.3)', alert: 'rgba(255, 0, 0, 0.3)' }
const thresholds = findThresholds(metricConfig, scope, typeof subCluster == 'string' ? cluster.subClusters.find(sc => sc.name == subCluster) : subCluster)
const thresholds = findThresholds(metricConfig, scope, typeof subCluster == 'string' ? cluster.subClusters.find(sc => sc.name == subCluster) : subCluster, isShared, hwthreads)
// converts the legend into a simple tooltip
function legendAsTooltipPlugin({ className, style = { backgroundColor:"rgba(255, 249, 196, 0.92)", color: "black" } } = {}) {
Expand Down Expand Up @@ -380,14 +381,14 @@
}
}
export function findThresholds(metricConfig, scope, subCluster) {
export function findThresholds(metricConfig, scope, subCluster, isShared, hwthreads) {
// console.log('NAME ' + metricConfig.name + ' / SCOPE ' + scope + ' / SUBCLUSTER ' + subCluster.name)
if (!metricConfig || !scope || !subCluster) {
console.warn('Argument missing for findThresholds!')
return null
}
if (scope == 'node' || metricConfig.aggregation == 'avg') {
if ((scope == 'node' && isShared == false) || metricConfig.aggregation == 'avg') {
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, peak: metricConfig.peak }
Expand All @@ -408,7 +409,9 @@
}
let divisor = 1
if (scope == 'socket')
if (isShared == true && hwthreads > 0) { // Shared
divisor = subCluster.topology.node.length / hwthreads
} else if (scope == 'socket')
divisor = subCluster.topology.socket.length
else if (scope == 'core')
divisor = subCluster.topology.core.length
Expand Down

0 comments on commit ec581e3

Please sign in to comment.