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

Method LoadDistribution

consistent.go:291–301  ·  view source on GitHub ↗

LoadDistribution exposes load distribution of members.

()

Source from the content-addressed store, hash-verified

289
290// LoadDistribution exposes load distribution of members.
291func (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.
304func (c *Consistent) FindPartitionID(key []byte) int {

Callers 1

TestConsistentLoadFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestConsistentLoadFunction · 0.64