MCPcopy Index your code
hub / github.com/dropbox/godropbox / LoadBalancedPool

Struct LoadBalancedPool

net2/http2/load_balanced_pool.go:68–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68type LoadBalancedPool struct {
69 lock sync.RWMutex
70
71 // Maps "host:port" -> instancePool.
72 instances map[string]*instancePool
73 instanceList instancePoolSlice
74
75 // shuffleSeed is used for shuffle sorting
76 shuffleSeed int
77 // hashSeed is used for consistent hashing
78 hashSeed uint32
79 // hashFunction is used for consistent hashing
80 hashFunction ConsistentHashFunc
81 // instanceHashes stores the hashes for the instances.
82 instanceHashes []uint32
83
84 // Atomic counter that is used for round robining instances
85 // from instanceList.
86 instanceIdx uint64
87
88 // Number of instances to round-robin between
89 activeSetSize uint64
90
91 // How long to mark a server unusable for.
92 markDownDuration time.Duration
93
94 // UNIX epoch time in seconds that represents time till address is considered
95 // as down and unusable.
96 markDownUntil []int64
97
98 params ConnectionParams // Parameters for creating SimplePool-s.
99 strategy LBStrategy // Load balancing strategy.
100}
101
102type instancePool struct {
103 SimplePool

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected