()
| 173 | } |
| 174 | |
| 175 | func (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 | |
| 184 | func (c *Consistent) distributeWithLoad(partID, idx int, partitions map[int]*Member, loads map[string]float64) { |
| 185 | avgLoad := c.averageLoad() |
no outgoing calls
no test coverage detected