diff --git a/internal/archiver/archiver.go b/internal/archiver/archiver.go index 1c4a3ec..1050ca1 100644 --- a/internal/archiver/archiver.go +++ b/internal/archiver/archiver.go @@ -60,12 +60,13 @@ func ArchiveJob(job *schema.Job, ctx context.Context) (*schema.JobMeta, error) { max = math.Max(max, series.Statistics.Max) } + // Round AVG Result 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), + Avg: (math.Round((avg/float64(job.NumNodes))*100) / 100), Min: min, Max: max, } diff --git a/internal/taskManager/updateFootprintService.go b/internal/taskManager/updateFootprintService.go index d30d766..a220855 100644 --- a/internal/taskManager/updateFootprintService.go +++ b/internal/taskManager/updateFootprintService.go @@ -94,7 +94,7 @@ func RegisterFootprintWorker() { } } - // Add values rounded to 2 digits + // Add values rounded to 2 digits: repo.LoadStats may return unrounded jobMeta.Statistics[metric] = schema.JobStatistics{ Unit: schema.Unit{ Prefix: archive.GetMetricConfig(job.Cluster, metric).Unit.Prefix,