From 218e56576ad0955808f69d25fbe771a1136ab3c7 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Mon, 30 Sep 2024 16:33:28 +0200 Subject: [PATCH] round calculated updateFootprint values to two digits --- internal/taskManager/updateFootprintService.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/taskManager/updateFootprintService.go b/internal/taskManager/updateFootprintService.go index 2a3eaef..b21502a 100644 --- a/internal/taskManager/updateFootprintService.go +++ b/internal/taskManager/updateFootprintService.go @@ -74,14 +74,15 @@ func RegisterFootprintWorker() { max = math.Max(max, series.Statistics.Max) } + // Add values rounded to 2 digits jobMeta.Statistics[metric] = schema.JobStatistics{ Unit: schema.Unit{ Prefix: archive.GetMetricConfig(job.Cluster, metric).Unit.Prefix, Base: archive.GetMetricConfig(job.Cluster, metric).Unit.Base, }, - Avg: avg / float64(job.NumNodes), - Min: min, - Max: max, + Avg: (math.Round((avg/float64(job.NumNodes))*100) / 100), + Min: (math.Round(min*100) / 100), + Max: (math.Round(max*100) / 100), } }