From 934d1a6114c72e53f37b9c994878dd22f683452d Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Wed, 23 Oct 2024 16:16:28 +0200 Subject: [PATCH] fix: use configured footprint statType for update --- internal/repository/job.go | 12 +++++++++++- web/frontend/src/generic/joblist/JobInfo.svelte | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/internal/repository/job.go b/internal/repository/job.go index 05d0acc..d1c54a1 100644 --- a/internal/repository/job.go +++ b/internal/repository/job.go @@ -642,7 +642,17 @@ func (r *JobRepository) UpdateFootprint( footprint := make(map[string]float64) for _, fp := range sc.Footprint { - statType := "avg" + var statType string + for _, gm := range archive.GlobalMetricList { + if gm.Name == fp { + statType = gm.Footprint + } + } + + if statType != "avg" && statType != "min" && statType != "max" { + log.Warnf("unknown statType for footprint update: %s", statType) + return stmt, fmt.Errorf("unknown statType for footprint update: %s", statType) + } if i, err := archive.MetricIndex(sc.MetricConfig, fp); err != nil { statType = sc.MetricConfig[i].Footprint diff --git a/web/frontend/src/generic/joblist/JobInfo.svelte b/web/frontend/src/generic/joblist/JobInfo.svelte index 2e71462..adacd4f 100644 --- a/web/frontend/src/generic/joblist/JobInfo.svelte +++ b/web/frontend/src/generic/joblist/JobInfo.svelte @@ -72,7 +72,7 @@ {:else}
{job.metaData.jobName}