IsHeartbeatHealthy returns whether the heartbeat timestamp for the ingester is within the specified timeout period.
(heartbeatTimeout time.Duration, now time.Time)
| 182 | // IsHeartbeatHealthy returns whether the heartbeat timestamp for the ingester is within the |
| 183 | // specified timeout period. |
| 184 | func (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. |
| 189 | func (i *InstanceDesc) IsReady(now time.Time, heartbeatTimeout time.Duration) error { |