MCPcopy
hub / github.com/grafana/dskit / GetInstanceState

Method GetInstanceState

ring/ring.go:1277–1284  ·  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

1275// GetInstanceState returns the current state of an instance or an error if the
1276// instance does not exist in the ring.
1277func (r *Ring) GetInstanceState(instanceID string) (InstanceState, error) {
1278 instance, err := r.GetInstance(instanceID)
1279 if err != nil {
1280 return PENDING, err
1281 }
1282
1283 return instance.GetState(), nil
1284}
1285
1286// HasInstance returns whether the ring contains an instance matching the provided instanceID.
1287func (r *Ring) HasInstance(instanceID string) bool {

Callers

nothing calls this directly

Calls 2

GetInstanceMethod · 0.95
GetStateMethod · 0.45

Tested by

no test coverage detected