mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-25 21:09:05 +01:00
Add footprint to global metric list
This commit is contained in:
parent
a07d167390
commit
68a97dc980
@ -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)
|
||||||
|
@ -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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user