@@ -30,6 +30,8 @@ import (
3030 "github.com/kubewharf/katalyst-core/pkg/agent/qrm-plugins/mb/plan"
3131)
3232
33+ const combinedGroupPrefix = "combined-"
34+
3335// getMinEffectiveCapacity identifies the min dynamic capacity required by pre-defined groups,
3436// if the specific groups have active MB traffics
3537func getMinEffectiveCapacity (base int , groupCaps map [string ]int , incomingStats monitor.GroupMBStats ) int {
@@ -206,8 +208,11 @@ func preProcessGroupSumStat(sumStats map[string][]monitor.MBInfo) map[string][]m
206208 continue
207209 }
208210
209- newKey := fmt .Sprintf ("combined-%d" , weight )
210- sumList := make ([]monitor.MBInfo , len (sumStats [equivGroups [0 ]]))
211+ newKey := getCombinedGroupKey (weight )
212+ // sumStats holds outgoing summary of each domain for each group, in other words,
213+ // each slot of sumStats has uniform shape: slice with length of domain number
214+ numDomains := len (sumStats [equivGroups [0 ]])
215+ sumList := make ([]monitor.MBInfo , numDomains )
211216
212217 for _ , group := range equivGroups {
213218 for id , stat := range sumStats [group ] {
@@ -222,6 +227,15 @@ func preProcessGroupSumStat(sumStats map[string][]monitor.MBInfo) map[string][]m
222227 return result
223228}
224229
230+ func getCombinedGroupKey (weight int ) string {
231+ newKey := fmt .Sprintf ("%s%d" , combinedGroupPrefix , weight )
232+ return newKey
233+ }
234+
235+ func isCombinedGroup (groupName string ) bool {
236+ return strings .Contains (groupName , combinedGroupPrefix )
237+ }
238+
225239func getLimitsByGroupSorted (capacity int , groupSorting []sets.String , groupUsages map [string ]int ) (int , map [string ]int ) {
226240 result := make (map [string ]int )
227241
0 commit comments