Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
zuqq committed Jun 27, 2023
1 parent fa1523e commit cc23cbe
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions internal/scheduler/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package scheduler

import (
"fmt"
"math"
"strconv"

"github.com/pkg/errors"
Expand Down Expand Up @@ -146,14 +145,3 @@ func GangIdAndCardinalityFromAnnotations(annotations map[string]string) (string,
}
return gangId, gangCardinality, true, nil
}

// ResourceListAsWeightedMillis returns the linear combination of the milli values in rl with given weights.
// This function overflows for values that exceed MaxInt64. E.g., 1Pi is fine but not 10Pi.
func ResourceListAsWeightedMillis(weights map[string]float64, rl schedulerobjects.ResourceList) int64 {
var rv int64
for t, f := range weights {
q := rl.Get(t)
rv += int64(math.Round(float64(q.MilliValue()) * f))
}
return rv
}

0 comments on commit cc23cbe

Please sign in to comment.