Skip to content

Commit 48fcf36

Browse files
committed
made QueueUsage a map
1 parent 66ccbf9 commit 48fcf36

File tree

6 files changed

+257
-253
lines changed

6 files changed

+257
-253
lines changed

pkg/scheduler/api/queue_info/quota_info.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44
package queue_info
55

6-
import "github.com/NVIDIA/KAI-scheduler/pkg/scheduler/api/common_info"
6+
import (
7+
"github.com/NVIDIA/KAI-scheduler/pkg/scheduler/api/common_info"
8+
v1 "k8s.io/api/core/v1"
9+
)
710

811
type QueueQuota struct {
912
GPU ResourceQuota `json:"gpu,omitempty"`
@@ -20,18 +23,14 @@ type ResourceQuota struct {
2023
Limit float64 `json:"limit"`
2124
}
2225

23-
type QueueUsage struct {
24-
GPU float64 `json:"gpu,omitempty"`
25-
CPU float64 `json:"cpu,omitempty"`
26-
Memory float64 `json:"memory,omitempty"`
27-
}
26+
type QueueUsage map[v1.ResourceName]float64
2827

2928
type ClusterUsage struct {
30-
Queues map[common_info.QueueID]*QueueUsage `json:"queues"`
29+
Queues map[common_info.QueueID]QueueUsage `json:"queues"`
3130
}
3231

3332
func NewClusterUsage() *ClusterUsage {
3433
return &ClusterUsage{
35-
Queues: make(map[common_info.QueueID]*QueueUsage),
34+
Queues: make(map[common_info.QueueID]QueueUsage),
3635
}
3736
}

0 commit comments

Comments
 (0)