start working on non-node-scoped metrics in node/system view

This commit is contained in:
Lou Knauer
2022-01-31 15:16:05 +01:00
parent 84431585f9
commit 29a25dbaff
8 changed files with 107 additions and 264 deletions

View File

@@ -1,5 +1,7 @@
package model
import "strconv"
type Cluster struct {
Name string `json:"name"`
MetricConfig []*MetricConfig `json:"metricConfig"`
@@ -76,3 +78,15 @@ func (topo *Topology) GetCoresFromHWThreads(hwthreads []int) (cores []int, exclu
return cores, exclusive
}
func (topo *Topology) GetAcceleratorIDs() ([]int, error) {
accels := make([]int, 0)
for _, accel := range topo.Accelerators {
id, err := strconv.Atoi(accel.ID)
if err != nil {
return nil, err
}
accels = append(accels, id)
}
return accels, nil
}

View File

@@ -101,14 +101,9 @@ type MetricFootprints struct {
Footprints []schema.Float `json:"footprints"`
}
type NodeMetric struct {
Name string `json:"name"`
Data []schema.Float `json:"data"`
}
type NodeMetrics struct {
ID string `json:"id"`
Metrics []*NodeMetric `json:"metrics"`
Host string `json:"host"`
Metrics []*JobMetricWithName `json:"metrics"`
}
type OrderByInput struct {