LoadDistribution exposes load distribution of members.
()
| 289 | |
| 290 | // LoadDistribution exposes load distribution of members. |
| 291 | func (c *Consistent) LoadDistribution() map[string]float64 { |
| 292 | c.mu.RLock() |
| 293 | defer c.mu.RUnlock() |
| 294 | |
| 295 | // Create a thread-safe copy |
| 296 | res := make(map[string]float64) |
| 297 | for member, load := range c.loads { |
| 298 | res[member] = load |
| 299 | } |
| 300 | return res |
| 301 | } |
| 302 | |
| 303 | // FindPartitionID returns partition id for given key. |
| 304 | func (c *Consistent) FindPartitionID(key []byte) int { |
no outgoing calls