improve metricplot threshold handling

- simplified and adaptive thresholds for shared jobs
This commit is contained in:
Christoph Kluge
2025-11-13 11:18:40 +01:00
parent 404be5f317
commit 2152ced97a

View File

@@ -13,7 +13,7 @@
- `statisticsSeries [GraphQL.StatisticsSeries]?`: Min/Max/Median representation of metric data [Default: null] - `statisticsSeries [GraphQL.StatisticsSeries]?`: Min/Max/Median representation of metric data [Default: null]
- `cluster String?`: Cluster name of the parent job / data [Default: ""] - `cluster String?`: Cluster name of the parent job / data [Default: ""]
- `subCluster String`: Name of the subCluster of the parent job - `subCluster String`: Name of the subCluster of the parent job
- `isShared Bool?`: If this job used shared resources; will adapt threshold indicators accordingly [Default: false] - `isShared Bool?`: If this job used shared resources; for additional legend display [Default: false]
- `forNode Bool?`: If this plot is used for node data display; will render x-axis as negative time with $now as maximum [Default: false] - `forNode Bool?`: If this plot is used for node data display; will render x-axis as negative time with $now as maximum [Default: false]
- `numhwthreads Number?`: Number of job HWThreads [Default: 0] - `numhwthreads Number?`: Number of job HWThreads [Default: 0]
- `numaccs Number?`: Number of job Accelerators [Default: 0] - `numaccs Number?`: Number of job Accelerators [Default: 0]
@@ -85,7 +85,6 @@
subClusterTopology, subClusterTopology,
metricConfig, metricConfig,
scope, scope,
isShared,
numhwthreads, numhwthreads,
numaccs numaccs
)); ));
@@ -279,7 +278,6 @@
subClusterTopology, subClusterTopology,
metricConfig, metricConfig,
scope, scope,
isShared,
numhwthreads, numhwthreads,
numaccs numaccs
) { ) {
@@ -295,32 +293,35 @@
scope = statParts[0] scope = statParts[0]
} }
if ( if (metricConfig?.aggregation == "avg") {
(scope == "node" && isShared == false) || // Return as Configured
metricConfig?.aggregation == "avg" return {
) { normal: metricConfig.normal,
return { caution: metricConfig.caution,
normal: metricConfig.normal, alert: metricConfig.alert,
caution: metricConfig.caution, peak: metricConfig.peak,
alert: metricConfig.alert, };
peak: metricConfig.peak,
};
} }
if (metricConfig?.aggregation == "sum") { if (metricConfig?.aggregation == "sum") {
// Scale Thresholds
let fraction;
if (numaccs > 0) fraction = subClusterTopology.accelerators.length / numaccs;
else if (numhwthreads > 0) fraction = subClusterTopology.core.length / numhwthreads;
else fraction = 1; // Fallback
let divisor; let divisor;
if (isShared == true) { // Shared // Exclusive: Fraction = 1; Shared: Fraction > 1
if (numaccs > 0) divisor = subClusterTopology.accelerators.length / numaccs; if (scope == 'node') divisor = fraction;
else if (numhwthreads > 0) divisor = subClusterTopology.core.length / numhwthreads; // Cap divisor at number of available sockets or domains
} else if (scope == 'socket') divisor = (fraction < subClusterTopology.socket.length) ? subClusterTopology.socket.length : fraction;
else if (scope == 'node') divisor = 1; // Use as configured for nodes else if (scope == "memoryDomain") divisor = (fraction < subClusterTopology.memoryDomain.length) ? subClusterTopology.socket.length : fraction;
else if (scope == 'socket') divisor = subClusterTopology.socket.length; // Use Maximum Division for Smallest Scopes
else if (scope == "memoryDomain") divisor = subClusterTopology.memoryDomain.length;
else if (scope == "core") divisor = subClusterTopology.core.length; else if (scope == "core") divisor = subClusterTopology.core.length;
else if (scope == "hwthread") divisor = subClusterTopology.core.length; // alt. name for core else if (scope == "hwthread") divisor = subClusterTopology.core.length; // alt. name for core
else if (scope == "accelerator") divisor = subClusterTopology.accelerators.length; else if (scope == "accelerator") divisor = subClusterTopology.accelerators.length;
else { else {
console.log('Unknown scope, return default aggregation thresholds ', scope) console.log('Unknown scope, return default aggregation thresholds for sum', scope)
divisor = 1; divisor = 1;
} }