@@ -93,17 +93,19 @@ func TestSchedule(t *testing.T) {
93
93
},
94
94
},
95
95
wantRes : & types.Result {
96
- TargetPod : & types.PodMetrics {
97
- Pod : & backendmetrics.Pod {NamespacedName : k8stypes.NamespacedName {Name : "pod2" }},
98
- Metrics : & backendmetrics.Metrics {
99
- WaitingQueueSize : 3 ,
100
- KVCacheUsagePercent : 0.1 ,
101
- MaxActiveModels : 2 ,
102
- ActiveModels : map [string ]int {
103
- "foo" : 1 ,
104
- "critical" : 1 ,
96
+ TargetPod : & types.ScoredPod {
97
+ Pod : & types.PodMetrics {
98
+ Pod : & backendmetrics.Pod {NamespacedName : k8stypes.NamespacedName {Name : "pod2" }},
99
+ Metrics : & backendmetrics.Metrics {
100
+ WaitingQueueSize : 3 ,
101
+ KVCacheUsagePercent : 0.1 ,
102
+ MaxActiveModels : 2 ,
103
+ ActiveModels : map [string ]int {
104
+ "foo" : 1 ,
105
+ "critical" : 1 ,
106
+ },
107
+ WaitingModels : map [string ]int {},
105
108
},
106
- WaitingModels : map [string ]int {},
107
109
},
108
110
},
109
111
},
@@ -154,17 +156,19 @@ func TestSchedule(t *testing.T) {
154
156
},
155
157
},
156
158
wantRes : & types.Result {
157
- TargetPod : & types.PodMetrics {
158
- Pod : & backendmetrics.Pod {NamespacedName : k8stypes.NamespacedName {Name : "pod1" }},
159
- Metrics : & backendmetrics.Metrics {
160
- WaitingQueueSize : 0 ,
161
- KVCacheUsagePercent : 0.2 ,
162
- MaxActiveModels : 2 ,
163
- ActiveModels : map [string ]int {
164
- "foo" : 1 ,
165
- "bar" : 1 ,
159
+ TargetPod : & types.ScoredPod {
160
+ Pod : & types.PodMetrics {
161
+ Pod : & backendmetrics.Pod {NamespacedName : k8stypes.NamespacedName {Name : "pod1" }},
162
+ Metrics : & backendmetrics.Metrics {
163
+ WaitingQueueSize : 0 ,
164
+ KVCacheUsagePercent : 0.2 ,
165
+ MaxActiveModels : 2 ,
166
+ ActiveModels : map [string ]int {
167
+ "foo" : 1 ,
168
+ "bar" : 1 ,
169
+ },
170
+ WaitingModels : map [string ]int {},
166
171
},
167
- WaitingModels : map [string ]int {},
168
172
},
169
173
},
170
174
},
@@ -505,7 +509,7 @@ func findPods(ctx *types.SchedulingContext, names ...k8stypes.NamespacedName) []
505
509
func getPodScore (scoredPods []* types.ScoredPod , selectedPod types.Pod ) float64 {
506
510
finalScore := 0.0
507
511
for _ , scoredPod := range scoredPods {
508
- if scoredPod .Pod . GetPod ().NamespacedName .String () == selectedPod .GetPod ().NamespacedName .String () {
512
+ if scoredPod .GetPod ().NamespacedName .String () == selectedPod .GetPod ().NamespacedName .String () {
509
513
finalScore = scoredPod .Score
510
514
break
511
515
}
0 commit comments