MCPcopy Create free account
hub / github.com/buraksezer/consistent / averageLoad

Method averageLoad

consistent.go:175–182  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

173}
174
175func (c *Consistent) averageLoad() float64 {
176 if len(c.members) == 0 {
177 return 0
178 }
179
180 avgLoad := float64(c.partitionCount/uint64(len(c.members))) * c.config.Load
181 return math.Ceil(avgLoad)
182}
183
184func (c *Consistent) distributeWithLoad(partID, idx int, partitions map[int]*Member, loads map[string]float64) {
185 avgLoad := c.averageLoad()

Callers 2

AverageLoadMethod · 0.95
distributeWithLoadMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected