heartbeat_health
Checks if a heartbeat/watchdog signal is still changing to confirm liveness; flags flatlined or stalled tags by comparing sample intervals against a maximum allowed gap.
Instructions
[READ][risk=low] Is a heartbeat/watchdog tag still alive? (liveness check).
A heartbeat must keep CHANGING; a flatlined one means the upstream is dead even
when comms/quality look fine. With timestamped samples + max_interval_s, also
flags the longest stall.
Args:
series: Heartbeat samples — scalars or {value, timestamp?} (a counter/toggle).
max_interval_s: Max allowed gap between changes; exceeding it = not alive.
Returns dict: {alive (bool), samples, distinct_transitions, spread,
longest_stall_s, reason}.
Example: heartbeat_health(series=[1,2,3,4,5], max_interval_s=10).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| series | Yes | ||
| max_interval_s | No |