mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 05:19:05 +01:00
Change footprint variabel from bool to string
The footprint variable also indicates the type of statistic used now
This commit is contained in:
parent
b6f011c669
commit
721b6b2afa
@ -194,7 +194,7 @@ type GlobalMetricListItem {
|
|||||||
name: String!
|
name: String!
|
||||||
unit: Unit!
|
unit: Unit!
|
||||||
scope: MetricScope!
|
scope: MetricScope!
|
||||||
footprint: Boolean
|
footprint: String
|
||||||
availability: [ClusterSupport!]!
|
availability: [ClusterSupport!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2022,7 +2022,7 @@ type GlobalMetricListItem {
|
|||||||
name: String!
|
name: String!
|
||||||
unit: Unit!
|
unit: Unit!
|
||||||
scope: MetricScope!
|
scope: MetricScope!
|
||||||
footprint: Boolean
|
footprint: String
|
||||||
availability: [ClusterSupport!]!
|
availability: [ClusterSupport!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3531,9 +3531,9 @@ func (ec *executionContext) _GlobalMetricListItem_footprint(ctx context.Context,
|
|||||||
if resTmp == nil {
|
if resTmp == nil {
|
||||||
return graphql.Null
|
return graphql.Null
|
||||||
}
|
}
|
||||||
res := resTmp.(bool)
|
res := resTmp.(string)
|
||||||
fc.Result = res
|
fc.Result = res
|
||||||
return ec.marshalOBoolean2bool(ctx, field.Selections, res)
|
return ec.marshalOString2string(ctx, field.Selections, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) fieldContext_GlobalMetricListItem_footprint(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
func (ec *executionContext) fieldContext_GlobalMetricListItem_footprint(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||||
@ -3543,7 +3543,7 @@ func (ec *executionContext) fieldContext_GlobalMetricListItem_footprint(_ contex
|
|||||||
IsMethod: false,
|
IsMethod: false,
|
||||||
IsResolver: false,
|
IsResolver: false,
|
||||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||||
return nil, errors.New("field of type Boolean does not have child fields")
|
return nil, errors.New("field of type String does not have child fields")
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return fc, nil
|
return fc, nil
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"scope": "node",
|
"scope": "node",
|
||||||
"aggregation": "avg",
|
"aggregation": "avg",
|
||||||
"footprint": true,
|
"footprint": "avg",
|
||||||
"timestep": 60,
|
"timestep": 60,
|
||||||
"peak": 72,
|
"peak": 72,
|
||||||
"normal": 72,
|
"normal": 72,
|
||||||
@ -36,7 +36,7 @@
|
|||||||
},
|
},
|
||||||
"scope": "node",
|
"scope": "node",
|
||||||
"aggregation": "sum",
|
"aggregation": "sum",
|
||||||
"footprint": true,
|
"footprint": "max",
|
||||||
"timestep": 60,
|
"timestep": 60,
|
||||||
"peak": 256,
|
"peak": 256,
|
||||||
"normal": 128,
|
"normal": 128,
|
||||||
@ -51,7 +51,7 @@
|
|||||||
},
|
},
|
||||||
"scope": "hwthread",
|
"scope": "hwthread",
|
||||||
"aggregation": "sum",
|
"aggregation": "sum",
|
||||||
"footprint": true,
|
"footprint": "avg",
|
||||||
"timestep": 60,
|
"timestep": 60,
|
||||||
"peak": 5600,
|
"peak": 5600,
|
||||||
"normal": 1000,
|
"normal": 1000,
|
||||||
@ -94,7 +94,7 @@
|
|||||||
},
|
},
|
||||||
"scope": "socket",
|
"scope": "socket",
|
||||||
"aggregation": "sum",
|
"aggregation": "sum",
|
||||||
"footprint": true,
|
"footprint": "avg",
|
||||||
"timestep": 60,
|
"timestep": 60,
|
||||||
"peak": 350,
|
"peak": 350,
|
||||||
"normal": 100,
|
"normal": 100,
|
||||||
|
@ -84,9 +84,9 @@ func initClusterConfig() error {
|
|||||||
newMetric.LowerIsBetter = cfg.LowerIsBetter
|
newMetric.LowerIsBetter = cfg.LowerIsBetter
|
||||||
sc.MetricConfig = append(sc.MetricConfig, *newMetric)
|
sc.MetricConfig = append(sc.MetricConfig, *newMetric)
|
||||||
|
|
||||||
if newMetric.Footprint {
|
if newMetric.Footprint != "" {
|
||||||
sc.Footprint = append(sc.Footprint, newMetric.Name)
|
sc.Footprint = append(sc.Footprint, newMetric.Name)
|
||||||
ml.Footprint = true
|
ml.Footprint = newMetric.Footprint
|
||||||
}
|
}
|
||||||
if newMetric.Energy {
|
if newMetric.Energy {
|
||||||
sc.EnergyFootprint = append(sc.EnergyFootprint, newMetric.Name)
|
sc.EnergyFootprint = append(sc.EnergyFootprint, newMetric.Name)
|
||||||
@ -96,7 +96,7 @@ func initClusterConfig() error {
|
|||||||
availability.SubClusters = append(availability.SubClusters, sc.Name)
|
availability.SubClusters = append(availability.SubClusters, sc.Name)
|
||||||
sc.MetricConfig = append(sc.MetricConfig, *newMetric)
|
sc.MetricConfig = append(sc.MetricConfig, *newMetric)
|
||||||
|
|
||||||
if newMetric.Footprint {
|
if newMetric.Footprint != "" {
|
||||||
sc.Footprint = append(sc.Footprint, newMetric.Name)
|
sc.Footprint = append(sc.Footprint, newMetric.Name)
|
||||||
}
|
}
|
||||||
if newMetric.Energy {
|
if newMetric.Energy {
|
||||||
|
10
pkg/archive/testdata/archive/alex/cluster.json
vendored
10
pkg/archive/testdata/archive/alex/cluster.json
vendored
@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"scope": "node",
|
"scope": "node",
|
||||||
"aggregation": "avg",
|
"aggregation": "avg",
|
||||||
"footprint": true,
|
"footprint": "avg",
|
||||||
"timestep": 60,
|
"timestep": 60,
|
||||||
"peak": 128,
|
"peak": 128,
|
||||||
"normal": 128,
|
"normal": 128,
|
||||||
@ -36,7 +36,7 @@
|
|||||||
},
|
},
|
||||||
"scope": "node",
|
"scope": "node",
|
||||||
"aggregation": "sum",
|
"aggregation": "sum",
|
||||||
"footprint": true,
|
"footprint": "max",
|
||||||
"timestep": 60,
|
"timestep": 60,
|
||||||
"peak": 512,
|
"peak": 512,
|
||||||
"normal": 128,
|
"normal": 128,
|
||||||
@ -51,7 +51,7 @@
|
|||||||
},
|
},
|
||||||
"scope": "hwthread",
|
"scope": "hwthread",
|
||||||
"aggregation": "sum",
|
"aggregation": "sum",
|
||||||
"footprint": true,
|
"footprint": "avg",
|
||||||
"timestep": 60,
|
"timestep": 60,
|
||||||
"peak": 9216,
|
"peak": 9216,
|
||||||
"normal": 1000,
|
"normal": 1000,
|
||||||
@ -66,7 +66,7 @@
|
|||||||
},
|
},
|
||||||
"scope": "socket",
|
"scope": "socket",
|
||||||
"aggregation": "sum",
|
"aggregation": "sum",
|
||||||
"footprint": true,
|
"footprint": "avg",
|
||||||
"timestep": 60,
|
"timestep": 60,
|
||||||
"peak": 350,
|
"peak": 350,
|
||||||
"normal": 100,
|
"normal": 100,
|
||||||
@ -108,7 +108,7 @@
|
|||||||
},
|
},
|
||||||
"scope": "accelerator",
|
"scope": "accelerator",
|
||||||
"aggregation": "avg",
|
"aggregation": "avg",
|
||||||
"footprint": true,
|
"footprint": "avg",
|
||||||
"timestep": 60,
|
"timestep": 60,
|
||||||
"peak": 100,
|
"peak": 100,
|
||||||
"normal": 80,
|
"normal": 80,
|
||||||
|
18
pkg/archive/testdata/archive/fritz/cluster.json
vendored
18
pkg/archive/testdata/archive/fritz/cluster.json
vendored
@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"scope": "node",
|
"scope": "node",
|
||||||
"aggregation": "avg",
|
"aggregation": "avg",
|
||||||
"footprint": true,
|
"footprint": "avg",
|
||||||
"timestep": 60,
|
"timestep": 60,
|
||||||
"peak": 72,
|
"peak": 72,
|
||||||
"normal": 72,
|
"normal": 72,
|
||||||
@ -20,7 +20,7 @@
|
|||||||
"peak": 104,
|
"peak": 104,
|
||||||
"normal": 104,
|
"normal": 104,
|
||||||
"caution": 52,
|
"caution": 52,
|
||||||
"footprint": true,
|
"footprint": "avg",
|
||||||
"alert": 20
|
"alert": 20
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -28,7 +28,7 @@
|
|||||||
"peak": 104,
|
"peak": 104,
|
||||||
"normal": 104,
|
"normal": 104,
|
||||||
"caution": 52,
|
"caution": 52,
|
||||||
"footprint": true,
|
"footprint": "avg",
|
||||||
"alert": 20
|
"alert": 20
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -54,7 +54,7 @@
|
|||||||
},
|
},
|
||||||
"scope": "node",
|
"scope": "node",
|
||||||
"aggregation": "sum",
|
"aggregation": "sum",
|
||||||
"footprint": true,
|
"footprint": "max",
|
||||||
"timestep": 60,
|
"timestep": 60,
|
||||||
"peak": 256,
|
"peak": 256,
|
||||||
"normal": 128,
|
"normal": 128,
|
||||||
@ -67,7 +67,7 @@
|
|||||||
"peak": 1024,
|
"peak": 1024,
|
||||||
"normal": 512,
|
"normal": 512,
|
||||||
"caution": 900,
|
"caution": 900,
|
||||||
"footprint": true,
|
"footprint": "max",
|
||||||
"lowerIsBetter": true,
|
"lowerIsBetter": true,
|
||||||
"alert": 1000
|
"alert": 1000
|
||||||
},
|
},
|
||||||
@ -76,7 +76,7 @@
|
|||||||
"peak": 2048,
|
"peak": 2048,
|
||||||
"normal": 1024,
|
"normal": 1024,
|
||||||
"caution": 1800,
|
"caution": 1800,
|
||||||
"footprint": true,
|
"footprint": "max",
|
||||||
"lowerIsBetter": true,
|
"lowerIsBetter": true,
|
||||||
"alert": 2000
|
"alert": 2000
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@
|
|||||||
},
|
},
|
||||||
"scope": "hwthread",
|
"scope": "hwthread",
|
||||||
"aggregation": "sum",
|
"aggregation": "sum",
|
||||||
"footprint": true,
|
"footprint": "avg",
|
||||||
"timestep": 60,
|
"timestep": 60,
|
||||||
"peak": 5600,
|
"peak": 5600,
|
||||||
"normal": 1000,
|
"normal": 1000,
|
||||||
@ -103,7 +103,7 @@
|
|||||||
"normal": 1500,
|
"normal": 1500,
|
||||||
"caution": 400,
|
"caution": 400,
|
||||||
"alert": 50,
|
"alert": 50,
|
||||||
"footprint": true
|
"footprint": "avg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "spr2tb",
|
"name": "spr2tb",
|
||||||
@ -187,7 +187,7 @@
|
|||||||
},
|
},
|
||||||
"scope": "socket",
|
"scope": "socket",
|
||||||
"aggregation": "sum",
|
"aggregation": "sum",
|
||||||
"footprint": true,
|
"footprint": "avg",
|
||||||
"timestep": 60,
|
"timestep": 60,
|
||||||
"peak": 350,
|
"peak": 350,
|
||||||
"normal": 100,
|
"normal": 100,
|
||||||
|
@ -51,7 +51,7 @@ type SubClusterConfig struct {
|
|||||||
Normal float64 `json:"normal"`
|
Normal float64 `json:"normal"`
|
||||||
Caution float64 `json:"caution"`
|
Caution float64 `json:"caution"`
|
||||||
Alert float64 `json:"alert"`
|
Alert float64 `json:"alert"`
|
||||||
Footprint bool `json:"footprint"`
|
Footprint string `json:"footprint,omitempty"`
|
||||||
Remove bool `json:"remove"`
|
Remove bool `json:"remove"`
|
||||||
LowerIsBetter bool `json:"lowerIsBetter"`
|
LowerIsBetter bool `json:"lowerIsBetter"`
|
||||||
Energy bool `json:"energy"`
|
Energy bool `json:"energy"`
|
||||||
@ -69,7 +69,7 @@ type MetricConfig struct {
|
|||||||
Caution float64 `json:"caution"`
|
Caution float64 `json:"caution"`
|
||||||
Alert float64 `json:"alert"`
|
Alert float64 `json:"alert"`
|
||||||
LowerIsBetter bool `json:"lowerIsBetter"`
|
LowerIsBetter bool `json:"lowerIsBetter"`
|
||||||
Footprint bool `json:"footprint"`
|
Footprint string `json:"footprint,omitempty"`
|
||||||
Energy bool `json:"energy"`
|
Energy bool `json:"energy"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ type GlobalMetricListItem struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Unit Unit `json:"unit"`
|
Unit Unit `json:"unit"`
|
||||||
Scope MetricScope `json:"scope"`
|
Scope MetricScope `json:"scope"`
|
||||||
Footprint bool `json:"footprint"`
|
Footprint string `json:"footprint,omitempty"`
|
||||||
Availability []ClusterSupport `json:"availability"`
|
Availability []ClusterSupport `json:"availability"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user