MCPcopy Create free account
hub / github.com/cortexproject/cortex / GetNumOfZones

Method GetNumOfZones

pkg/ring/replication_set.go:144–150  ·  view source on GitHub ↗

GetNumOfZones returns number of distinct zones.

()

Source from the content-addressed store, hash-verified

142
143// GetNumOfZones returns number of distinct zones.
144func (r ReplicationSet) GetNumOfZones() int {
145 set := make(map[string]struct{})
146 for _, instance := range r.Instances {
147 set[instance.GetZone()] = struct{}{}
148 }
149 return len(set)
150}
151
152// HasReplicationSetChanged returns false if two replications sets are the same (with possibly different timestamps),
153// true if they differ in any way (number of instances, instance states, tokens, zones, ...).

Callers 1

getNonExcludedInstanceFunction · 0.80

Calls 1

GetZoneMethod · 0.80

Tested by

no test coverage detected