Merge pull request #270 from ClusterCockpit/hotfix

fix: make foorprint from statsSeries nullsafe
This commit is contained in:
Christoph Kluge 2024-06-21 09:38:16 +02:00 committed by GitHub
commit 41bbd203cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -101,7 +101,10 @@
// Calculate Avg from jobMetrics // Calculate Avg from jobMetrics
const jm = jobMetrics.find((jm) => jm.name === fm && jm.scope === "node"); const jm = jobMetrics.find((jm) => jm.name === fm && jm.scope === "node");
if (jm?.metric?.statisticsSeries) { if (jm?.metric?.statisticsSeries) {
mv = round(mean(jm.metric.statisticsSeries.mean), 2); const noNan = jm.metric.statisticsSeries.mean.filter(function (val) {
return val != null;
});
mv = round(mean(noNan), 2);
} 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);