mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 05:19:05 +01:00
Merge pull request #270 from ClusterCockpit/hotfix
fix: make foorprint from statsSeries nullsafe
This commit is contained in:
commit
41bbd203cc
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user