feat: Add total energy and energy footprint

This commit is contained in:
2024-08-29 07:26:49 +02:00
parent f305863616
commit 5b03cf826b
4 changed files with 76 additions and 8 deletions

View File

@@ -221,3 +221,13 @@ func GetSubClusterByNode(cluster, hostname string) (string, error) {
return "", fmt.Errorf("ARCHIVE/CLUSTERCONFIG > no subcluster found for cluster %v and host %v", cluster, hostname)
}
func MetricIndex(mc []schema.MetricConfig, name string) (int, error) {
for i, m := range mc {
if m.Name == name {
return i, nil
}
}
return 0, fmt.Errorf("Unknown metric name %s", name)
}