mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-22 20:41:40 +02:00
Add LowerIsBetter Metric boolean. Upgrade dependencies.
This commit is contained in:
@@ -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 {
|
||||
|
@@ -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()
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
]
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user