Replace m[k]=v loop with maps.Copy

This commit is contained in:
Holger Obermaier
2026-02-06 14:50:00 +01:00
parent baf7a4f2c5
commit 77a9b5a977
3 changed files with 7 additions and 12 deletions

View File

@@ -19,6 +19,7 @@ import (
"encoding/json"
"errors"
"fmt"
"maps"
"math"
"os"
"os/signal"
@@ -767,9 +768,7 @@ func (m *LikwidCollector) calcGlobalMetrics(groups []LikwidEventsetConfig, inter
// Here we generate parameter list
params := make(map[string]float64)
for _, evset := range groups {
for mname, mres := range evset.metrics[tid] {
params[mname] = mres
}
maps.Copy(params, evset.metrics[tid])
}
params["gotime"] = interval.Seconds()
// Evaluate the metric