mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Add a sum() helper to the CPUManager cpuassignment logic
Signed-off-by: Kevin Klues <kklues@nvidia.com>
This commit is contained in:
parent
cfacc22459
commit
dc4430b663
@ -63,6 +63,14 @@ func (m mapIntInt) Values(keys ...int) []int {
|
|||||||
return values
|
return values
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func sum(xs []int) int {
|
||||||
|
var s int
|
||||||
|
for _, x := range xs {
|
||||||
|
s += x
|
||||||
|
}
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
|
||||||
func mean(xs []int) float64 {
|
func mean(xs []int) float64 {
|
||||||
var sum float64
|
var sum float64
|
||||||
for _, x := range xs {
|
for _, x := range xs {
|
||||||
|
Loading…
Reference in New Issue
Block a user