Three changes to cut wasted device/cellular load and surface outages:
- Adaptive interval: full-rate (~1.25s) while a browser is subscribed for a
smooth chart; relaxed cadence (MONITOR_IDLE_POLL_INTERVAL, default 10s) when
the feed is keepalive-only (alerting). ~8x fewer polls with no viewer ->
~8x less cellular traffic on a metered SIM. Note: idle interval also sets the
alert sampling resolution when nobody is watching.
- Exponential backoff when the device is unreachable (1->2->...->60s cap),
reset on the first good poll, so a dead/asleep device stops churning
reconnects (log spam + wasted SYN traffic). Capped at 5s while a browser is
watching so a recovery still surfaces quickly.
- Device-offline alert: the reachable->unreachable transition raises a
connectivity AlertEvent (sentinel rule_id=0, metric="connectivity") through
the existing evaluator/dispatch seam; recovery clears it. Deduped in memory
and via the DB (so a restart mid-outage doesn't duplicate the event).
MonitorManager.status() now reports reachable + current mode (watched/idle/
backoff) for observability.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>