MCPcopy Index your code
hub / github.com/cortexproject/cortex / GetInstanceState

Method GetInstanceState

pkg/ring/ring.go:914–925  ·  view source on GitHub ↗

GetInstanceState returns the current state of an instance or an error if the instance does not exist in the ring.

(instanceID string)

Source from the content-addressed store, hash-verified

912// GetInstanceState returns the current state of an instance or an error if the
913// instance does not exist in the ring.
914func (r *Ring) GetInstanceState(instanceID string) (InstanceState, error) {
915 r.mtx.RLock()
916 defer r.mtx.RUnlock()
917
918 instances := r.ringDesc.GetIngesters()
919 instance, ok := instances[instanceID]
920 if !ok {
921 return PENDING, ErrInstanceNotFound
922 }
923
924 return instance.GetState(), nil
925}
926
927// GetInstanceIdByAddr implements ReadRing.
928func (r *Ring) GetInstanceIdByAddr(addr string) (string, error) {

Callers

nothing calls this directly

Calls 2

GetIngestersMethod · 0.80
GetStateMethod · 0.45

Tested by

no test coverage detected