Skip to content

Commit

Permalink
Change footprint variabel from bool to string
Browse files Browse the repository at this point in the history
The footprint variable also indicates the type of statistic used now
  • Loading branch information
moebiusband73 committed Jul 20, 2024
1 parent b6f011c commit 721b6b2
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion api/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ type GlobalMetricListItem {
name: String!
unit: Unit!
scope: MetricScope!
footprint: Boolean
footprint: String
availability: [ClusterSupport!]!
}

Expand Down
8 changes: 4 additions & 4 deletions internal/graph/generated/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions internal/importer/testdata/cluster-fritz.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"scope": "node",
"aggregation": "avg",
"footprint": true,
"footprint": "avg",
"timestep": 60,
"peak": 72,
"normal": 72,
Expand Down Expand Up @@ -36,7 +36,7 @@
},
"scope": "node",
"aggregation": "sum",
"footprint": true,
"footprint": "max",
"timestep": 60,
"peak": 256,
"normal": 128,
Expand All @@ -51,7 +51,7 @@
},
"scope": "hwthread",
"aggregation": "sum",
"footprint": true,
"footprint": "avg",
"timestep": 60,
"peak": 5600,
"normal": 1000,
Expand Down Expand Up @@ -94,7 +94,7 @@
},
"scope": "socket",
"aggregation": "sum",
"footprint": true,
"footprint": "avg",
"timestep": 60,
"peak": 350,
"normal": 100,
Expand Down
6 changes: 3 additions & 3 deletions pkg/archive/clusterConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ func initClusterConfig() error {
newMetric.LowerIsBetter = cfg.LowerIsBetter
sc.MetricConfig = append(sc.MetricConfig, *newMetric)

if newMetric.Footprint {
if newMetric.Footprint != "" {
sc.Footprint = append(sc.Footprint, newMetric.Name)
ml.Footprint = true
ml.Footprint = newMetric.Footprint
}
if newMetric.Energy {
sc.EnergyFootprint = append(sc.EnergyFootprint, newMetric.Name)
Expand All @@ -96,7 +96,7 @@ func initClusterConfig() error {
availability.SubClusters = append(availability.SubClusters, sc.Name)
sc.MetricConfig = append(sc.MetricConfig, *newMetric)

if newMetric.Footprint {
if newMetric.Footprint != "" {
sc.Footprint = append(sc.Footprint, newMetric.Name)
}
if newMetric.Energy {
Expand Down
10 changes: 5 additions & 5 deletions pkg/archive/testdata/archive/alex/cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"scope": "node",
"aggregation": "avg",
"footprint": true,
"footprint": "avg",
"timestep": 60,
"peak": 128,
"normal": 128,
Expand Down Expand Up @@ -36,7 +36,7 @@
},
"scope": "node",
"aggregation": "sum",
"footprint": true,
"footprint": "max",
"timestep": 60,
"peak": 512,
"normal": 128,
Expand All @@ -51,7 +51,7 @@
},
"scope": "hwthread",
"aggregation": "sum",
"footprint": true,
"footprint": "avg",
"timestep": 60,
"peak": 9216,
"normal": 1000,
Expand All @@ -66,7 +66,7 @@
},
"scope": "socket",
"aggregation": "sum",
"footprint": true,
"footprint": "avg",
"timestep": 60,
"peak": 350,
"normal": 100,
Expand Down Expand Up @@ -108,7 +108,7 @@
},
"scope": "accelerator",
"aggregation": "avg",
"footprint": true,
"footprint": "avg",
"timestep": 60,
"peak": 100,
"normal": 80,
Expand Down
18 changes: 9 additions & 9 deletions pkg/archive/testdata/archive/fritz/cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"scope": "node",
"aggregation": "avg",
"footprint": true,
"footprint": "avg",
"timestep": 60,
"peak": 72,
"normal": 72,
Expand All @@ -20,15 +20,15 @@
"peak": 104,
"normal": 104,
"caution": 52,
"footprint": true,
"footprint": "avg",
"alert": 20
},
{
"name": "spr2tb",
"peak": 104,
"normal": 104,
"caution": 52,
"footprint": true,
"footprint": "avg",
"alert": 20
}
]
Expand All @@ -54,7 +54,7 @@
},
"scope": "node",
"aggregation": "sum",
"footprint": true,
"footprint": "max",
"timestep": 60,
"peak": 256,
"normal": 128,
Expand All @@ -67,7 +67,7 @@
"peak": 1024,
"normal": 512,
"caution": 900,
"footprint": true,
"footprint": "max",
"lowerIsBetter": true,
"alert": 1000
},
Expand All @@ -76,7 +76,7 @@
"peak": 2048,
"normal": 1024,
"caution": 1800,
"footprint": true,
"footprint": "max",
"lowerIsBetter": true,
"alert": 2000
}
Expand All @@ -90,7 +90,7 @@
},
"scope": "hwthread",
"aggregation": "sum",
"footprint": true,
"footprint": "avg",
"timestep": 60,
"peak": 5600,
"normal": 1000,
Expand All @@ -103,7 +103,7 @@
"normal": 1500,
"caution": 400,
"alert": 50,
"footprint": true
"footprint": "avg"
},
{
"name": "spr2tb",
Expand Down Expand Up @@ -187,7 +187,7 @@
},
"scope": "socket",
"aggregation": "sum",
"footprint": true,
"footprint": "avg",
"timestep": 60,
"peak": 350,
"normal": 100,
Expand Down
6 changes: 3 additions & 3 deletions pkg/schema/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type SubClusterConfig struct {
Normal float64 `json:"normal"`
Caution float64 `json:"caution"`
Alert float64 `json:"alert"`
Footprint bool `json:"footprint"`
Footprint string `json:"footprint,omitempty"`
Remove bool `json:"remove"`
LowerIsBetter bool `json:"lowerIsBetter"`
Energy bool `json:"energy"`
Expand All @@ -69,7 +69,7 @@ type MetricConfig struct {
Caution float64 `json:"caution"`
Alert float64 `json:"alert"`
LowerIsBetter bool `json:"lowerIsBetter"`
Footprint bool `json:"footprint"`
Footprint string `json:"footprint,omitempty"`
Energy bool `json:"energy"`
}

Expand All @@ -88,7 +88,7 @@ type GlobalMetricListItem struct {
Name string `json:"name"`
Unit Unit `json:"unit"`
Scope MetricScope `json:"scope"`
Footprint bool `json:"footprint"`
Footprint string `json:"footprint,omitempty"`
Availability []ClusterSupport `json:"availability"`
}

Expand Down

0 comments on commit 721b6b2

Please sign in to comment.