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
}
]

View File

@@ -46,28 +46,31 @@ type SubCluster struct {
}
type SubClusterConfig struct {
Name string `json:"name"`
Peak float64 `json:"peak"`
Normal float64 `json:"normal"`
Caution float64 `json:"caution"`
Alert float64 `json:"alert"`
Footprint bool `json:"footprint"`
Remove bool `json:"remove"`
Name string `json:"name"`
Peak float64 `json:"peak"`
Normal float64 `json:"normal"`
Caution float64 `json:"caution"`
Alert float64 `json:"alert"`
Footprint bool `json:"footprint"`
Remove bool `json:"remove"`
LowerIsBetter bool `json:"lowerIsBetter"`
Energy bool `json:"energy"`
}
type MetricConfig struct {
Unit Unit `json:"unit"`
Name string `json:"name"`
Scope MetricScope `json:"scope"`
Aggregation string `json:"aggregation"`
SubClusters []*SubClusterConfig `json:"subClusters,omitempty"`
Timestep int `json:"timestep"`
Peak float64 `json:"peak"`
Normal float64 `json:"normal"`
Caution float64 `json:"caution"`
Alert float64 `json:"alert"`
Footprint bool `json:"footprint"`
Energy bool `json:"energy"`
Unit Unit `json:"unit"`
Name string `json:"name"`
Scope MetricScope `json:"scope"`
Aggregation string `json:"aggregation"`
SubClusters []*SubClusterConfig `json:"subClusters,omitempty"`
Timestep int `json:"timestep"`
Peak float64 `json:"peak"`
Normal float64 `json:"normal"`
Caution float64 `json:"caution"`
Alert float64 `json:"alert"`
LowerIsBetter bool `json:"lowerIsBetter"`
Footprint bool `json:"footprint"`
Energy bool `json:"energy"`
}
type Cluster struct {