code wiki / _hdl_build / nx_pub_recover_pulsed.nx

nx_pub_recover_pulsed.nx

buildroot/runtime/_hdl_build/nx_pub_recover_pulsed.nx

3059 B50 linesdepth 6pulls 8 transitivereach 1 importersview sourcekind tooltopic pub
docsdependenciesstructsconstsfunctions

about

nx_pub_recover_pulsed.nx -- the Publisher self-healing pulse as a CADENCE DAEMON (the runnable service form). Each cycle: optionally refresh the metrics by running the collector (nx_apm_sweep), then run one pulse_pass (decide + execute, with the kill-storm cooldown). Decoupled: if no collector path is given, it heals from whatever metrics the collector wrote on its own schedule (clean collector/healer separation, New-Relic-style). pulsed_run(interval_sec, max_cycles[0=forever], collector_elf_or_empty) -> cycles run argv: nx_pub_recover_pulsed [interval_sec=60] [max_cycles=0] [collector_elf] The Publisher (its supervision rung) keeps THIS daemon alive; THIS daemon keeps the site daemons healthy. license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_pub_recover_pulse.nx nx_pub_recover_pulsed.nx nx_pub_recover_pulsed_gate.nx

imports: nx_syscalls.nxnx_pub_recover_pulse.nx

imported by: nx_pub_recover_pulsed_gate.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main pd_atoi pd_uw sys_write pulsed_run sys_fork sys_mmap sys_execve sys_exit sys_wait4 pulse_pass pp_decide sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close pr_field pp_strlen pp_map_lookup sys_mmap ↻ sys_read_file ↻ pr_field ↻ pp_recent_recoveries sys_mmap ↻ sys_read_file ↻ pr_field ↻ fl_acquire fl_try fl_mkdir sys_mmap ↻ fl_path sys_openat_wr sys_flock sys_close ↻ fl_nap sys_mmap ↻ pr_already_pending

structs

none

consts

11const PD_MAGIC_5000: i64 = 5000
13const PD_METRICS: *u8 = "knowledge/status/apm_metrics.tsv"
14const PD_QUEUE: *u8 = "knowledge/publish/recovery_queue.tsv"
15const PD_LEDGER: *u8 = "knowledge/publish/recovery_ledger.tsv"
16const PD_MAP: *u8 = "knowledge/publish/recover_map.tsv"

functions

18func pulsed_run(interval_sec: i64, max_cycles: i64, collector_elf: *u8, metrics: *u8, queue: *u8, ledger: *u8, map: *u8) -> i64
39func pd_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v }
called by 1: main
40func pd_uw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
41func main(argc: i64, argv: *i64) -> i64