11 Commits

Author SHA1 Message Date
Jan Eitzinger
97330ce598 Merge pull request #532 from ClusterCockpit/hotfix
Remove static linkage for helper tools
2026-03-20 09:37:34 +01:00
Jan Eitzinger
d4ee937115 Merge pull request #531 from ClusterCockpit/hotfix
Fix goreleaser config. Cleanup.
2026-03-20 09:25:04 +01:00
Jan Eitzinger
4ce0cfb686 Merge pull request #530 from ClusterCockpit/hotfix
Hotfix
2026-03-20 08:41:27 +01:00
Jan Eitzinger
a9f335d910 Merge pull request #529 from ClusterCockpit/hotfix
Hotfix
2026-03-20 05:50:18 +01:00
Jan Eitzinger
676025adfe Merge pull request #528 from ClusterCockpit/hotfix
further clarify plot titles
2026-03-19 11:44:12 +01:00
Jan Eitzinger
d4a0ae173f Merge pull request #525 from ClusterCockpit/hotfix
Hotfix
2026-03-18 19:31:05 +01:00
Jan Eitzinger
a7e5ecaf6c Merge pull request #524 from ClusterCockpit/hotfix
Remove tracked .entire/metadata/ files from git
2026-03-18 07:15:36 +01:00
Jan Eitzinger
965e2007fb Merge pull request #523 from ClusterCockpit/hotfix
Hotfix
2026-03-18 07:04:12 +01:00
Jan Eitzinger
6a29faf460 Merge pull request #521 from ClusterCockpit/hotfix
Hotfix
2026-03-17 09:23:59 +01:00
Jan Eitzinger
8751ae023d Merge pull request #520 from ClusterCockpit/hotfix
Extend known issues in ReleaseNotes
2026-03-15 07:22:20 +01:00
Jan Eitzinger
128c098865 Merge pull request #519 from ClusterCockpit/hotfix
Hotfix
2026-03-13 17:39:04 +01:00
2 changed files with 29 additions and 36 deletions

View File

@@ -198,12 +198,25 @@ func GetSubCluster(cluster, subcluster string) (*schema.SubCluster, error) {
func GetMetricConfigSubCluster(cluster, subcluster string) map[string]*schema.Metric {
metrics := make(map[string]*schema.Metric)
sc, err := GetSubCluster(cluster, subcluster)
if err != nil {
return metrics
for _, c := range Clusters {
if c.Name == cluster {
for _, m := range c.MetricConfig {
for _, s := range m.SubClusters {
if s.Name == subcluster {
metrics[m.Name] = &schema.Metric{
Name: m.Name,
Unit: s.Unit,
Peak: s.Peak,
Normal: s.Normal,
Caution: s.Caution,
Alert: s.Alert,
}
break
}
}
for _, m := range sc.MetricConfig {
_, ok := metrics[m.Name]
if !ok {
metrics[m.Name] = &schema.Metric{
Name: m.Name,
Unit: m.Unit,
@@ -213,6 +226,10 @@ func GetMetricConfigSubCluster(cluster, subcluster string) map[string]*schema.Me
Alert: m.Alert,
}
}
}
break
}
}
return metrics
}

View File

@@ -37,27 +37,3 @@ func TestClusterConfig(t *testing.T) {
// spew.Dump(archive.GlobalMetricList)
// t.Fail()
}
func TestGetMetricConfigSubClusterRespectsRemovedMetrics(t *testing.T) {
if err := archive.Init(json.RawMessage(`{"kind": "file","path": "testdata/archive"}`)); err != nil {
t.Fatal(err)
}
sc, err := archive.GetSubCluster("fritz", "spr2tb")
if err != nil {
t.Fatal(err)
}
metrics := archive.GetMetricConfigSubCluster("fritz", "spr2tb")
if len(metrics) != len(sc.MetricConfig) {
t.Fatalf("GetMetricConfigSubCluster() returned %d metrics, want %d", len(metrics), len(sc.MetricConfig))
}
if _, ok := metrics["flops_any"]; ok {
t.Fatalf("GetMetricConfigSubCluster() returned removed metric flops_any for subcluster spr2tb")
}
if _, ok := metrics["cpu_power"]; !ok {
t.Fatalf("GetMetricConfigSubCluster() missing active metric cpu_power for subcluster spr2tb")
}
}