code wiki / (root) / nx_progress_watchdog.nx

nx_progress_watchdog.nx

buildroot/runtime/nx_progress_watchdog.nx

2332 B65 linesdepth 3pulls 3 transitivereach 20 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_progress_watchdog.nx -- detects stalled phases in long ingest runs. A heartbeat-based liveness monitor: caller heartbeats at progress points; check() reports STALLED if too much wall-clock has elapsed since the last heartbeat. Lightweight: zero syscalls per heartbeat (just stores the timestamp); one clock read per check. genealogy_id: ibm_360_watchdog_timer + os_softdog_1990s lineage_id: liveness_monitor

dependencies 3 imports · 3 importers

nx_syscalls.nx nx_tier.nx nx_clock.nx nx_progress_watchdog.nx nx_ingest_runner.nx nx_ingest_runner_test.nx nx_progress_watchdog_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_clock.nx

imported by: nx_ingest_runner.nxnx_ingest_runner_test.nxnx_progress_watchdog_test.nx

structs

24struct NxWatchdog

consts

21const NX_WATCHDOG_OK: nx_int = 0
22const NX_WATCHDOG_STALLED: nx_int = 1

functions

31func nx_progress_watchdog_new(stall_timeout_ms: nx_int) -> *NxWatchdog
41func nx_progress_watchdog_heartbeat(w: *NxWatchdog) -> nx_int
47func nx_progress_watchdog_check(w: *NxWatchdog) -> nx_int
57func nx_progress_watchdog_elapsed_ms(w: *NxWatchdog) -> nx_int
called by 1: main calls 1: nx_clock_monotonic_ns
63func nx_progress_watchdog_n_heartbeats(w: *NxWatchdog) -> nx_int { return w.n_heartbeats }
called by 1: main
64func nx_progress_watchdog_n_stalls(w: *NxWatchdog) -> nx_int { return w.n_stalls_detected }
called by 1: main
65func nx_progress_watchdog_stall_timeout_ms(w: *NxWatchdog) -> nx_int { return w.stall_timeout_ns / NX_NS_PER_MS }
called by 1: main