Add LowerIsBetter Metric boolean. Upgrade dependencies.

This commit is contained in:
2024-07-11 16:58:12 +02:00
parent e8e3b1595d
commit b64ce1f67f
9 changed files with 506 additions and 2131 deletions

View File

@@ -78,6 +78,8 @@ func initClusterConfig() error {
newMetric.Caution = cfg.Caution
newMetric.Alert = cfg.Alert
newMetric.Footprint = cfg.Footprint
newMetric.Energy = cfg.Energy
newMetric.LowerIsBetter = cfg.LowerIsBetter
sc.MetricConfig = append(sc.MetricConfig, *newMetric)
if newMetric.Footprint {

View File

@@ -28,6 +28,12 @@ func TestClusterConfig(t *testing.T) {
t.Fail()
}
for _, metric := range sc.MetricConfig {
if metric.LowerIsBetter && metric.Name != "mem_used" {
t.Fail()
}
}
// spew.Dump(archive.GlobalMetricList)
// t.Fail()
}

View File

@@ -60,6 +60,7 @@
"normal": 128,
"caution": 200,
"alert": 240,
"lowerIsBetter": true,
"subClusters": [
{
"name": "spr1tb",
@@ -67,6 +68,7 @@
"normal": 512,
"caution": 900,
"footprint": true,
"lowerIsBetter": true,
"alert": 1000
},
{
@@ -75,6 +77,7 @@
"normal": 1024,
"caution": 1800,
"footprint": true,
"lowerIsBetter": true,
"alert": 2000
}
]