MCPcopy Create free account
hub / github.com/cozystack/cozystack / argmaxLoad

Function argmaxLoad

internal/fluxshardoperator/placement.go:186–194  ·  view source on GitHub ↗

argmaxLoad returns the most-loaded shard index, tie-break lowest index.

(load []int)

Source from the content-addressed store, hash-verified

184
185// argmaxLoad returns the most-loaded shard index, tie-break lowest index.
186func argmaxLoad(load []int) int {
187 idx := 0
188 for i, l := range load {
189 if l > load[idx] {
190 idx = i
191 }
192 }
193 return idx
194}
195
196func abs(v int) int {
197 if v < 0 {

Callers 1

rebalanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected