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

Method IsHeartbeatHealthy

ring/model.go:184–186  ·  view source on GitHub ↗

IsHeartbeatHealthy returns whether the heartbeat timestamp for the ingester is within the specified timeout period.

(heartbeatTimeout time.Duration, now time.Time)

Source from the content-addressed store, hash-verified

182// IsHeartbeatHealthy returns whether the heartbeat timestamp for the ingester is within the
183// specified timeout period.
184func (i *InstanceDesc) IsHeartbeatHealthy(heartbeatTimeout time.Duration, now time.Time) bool {
185 return now.Sub(time.Unix(i.Timestamp, 0)) <= heartbeatTimeout
186}
187
188// IsReady returns no error if the instance is ACTIVE and healthy.
189func (i *InstanceDesc) IsReady(now time.Time, heartbeatTimeout time.Duration) error {

Callers 2

IsHealthyMethod · 0.95
IsReadyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected