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

Function argminLoad

internal/fluxshardoperator/placement.go:175–183  ·  view source on GitHub ↗

argminLoad returns the least-loaded shard index, tie-break lowest index.

(load []int)

Source from the content-addressed store, hash-verified

173
174// argminLoad returns the least-loaded shard index, tie-break lowest index.
175func argminLoad(load []int) int {
176 idx := 0
177 for i, l := range load {
178 if l < load[idx] {
179 idx = i
180 }
181 }
182 return idx
183}
184
185// argmaxLoad returns the most-loaded shard index, tie-break lowest index.
186func argmaxLoad(load []int) int {

Callers 2

ComputePlacementFunction · 0.85
rebalanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected