Add footprint to global metric list

This commit is contained in:
Jan Eitzinger 2024-07-12 13:20:54 +02:00
parent a07d167390
commit 68a97dc980
Signed by: moebiusband
GPG Key ID: 2574BA29B90D6DD5
2 changed files with 5 additions and 1 deletions

View File

@ -55,7 +55,9 @@ func initClusterConfig() error {
ml, ok := metricLookup[mc.Name] ml, ok := metricLookup[mc.Name]
if !ok { if !ok {
metricLookup[mc.Name] = schema.GlobalMetricListItem{Name: mc.Name, Scope: mc.Scope, Unit: mc.Unit} metricLookup[mc.Name] = schema.GlobalMetricListItem{
Name: mc.Name, Scope: mc.Scope, Unit: mc.Unit, Footprint: mc.Footprint,
}
ml = metricLookup[mc.Name] ml = metricLookup[mc.Name]
} }
availability := schema.ClusterSupport{Cluster: cluster.Name} availability := schema.ClusterSupport{Cluster: cluster.Name}
@ -84,6 +86,7 @@ func initClusterConfig() error {
if newMetric.Footprint { if newMetric.Footprint {
sc.Footprint = append(sc.Footprint, newMetric.Name) sc.Footprint = append(sc.Footprint, newMetric.Name)
ml.Footprint = true
} }
if newMetric.Energy { if newMetric.Energy {
sc.EnergyFootprint = append(sc.EnergyFootprint, newMetric.Name) sc.EnergyFootprint = append(sc.EnergyFootprint, newMetric.Name)

View File

@ -88,6 +88,7 @@ type GlobalMetricListItem struct {
Name string `json:"name"` Name string `json:"name"`
Unit Unit `json:"unit"` Unit Unit `json:"unit"`
Scope MetricScope `json:"scope"` Scope MetricScope `json:"scope"`
Footprint bool `json:"footprint"`
Availability []ClusterSupport `json:"availability"` Availability []ClusterSupport `json:"availability"`
} }