mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 21:01:40 +02:00
start working on non-node-scoped metrics in node/system view
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user