Skip to content

Commit

Permalink
fix: make foorprint from statsSeries nullsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
spacehamster87 committed Jun 19, 2024
1 parent 70e6376 commit 4344c26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/frontend/src/JobFootprint.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@
// Calculate Avg from jobMetrics
const jm = jobMetrics.find((jm) => jm.name === fm && jm.scope === "node");
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) {
const avgs = jm.metric.series.map((jms) => jms.statistics.avg);
mv = round(mean(avgs), 2);
Expand Down

0 comments on commit 4344c26

Please sign in to comment.