Expand description
agent-heartbeat: periodic heartbeat recorder and stall detector for AI agents.
Agents call ping() at regular intervals. If no ping arrives within
the configured window, is_stale(now_ms) returns true.
use agent_heartbeat::Heartbeat;
let mut hb = Heartbeat::new("worker-1").interval_ms(5_000);
hb.ping(1000);
assert!(!hb.is_stale(3000));
assert!(hb.is_stale(9000));Structsยง
- Heartbeat
- Tracks periodic pings from an agent and detects stalls.