code wiki / _hdl_build / nx_pub_recover_pulsed.nx
nx_pub_recover_pulsed.nx
buildroot/runtime/_hdl_build/nx_pub_recover_pulsed.nx
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
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
structs
| none |
consts
| 11 | const PD_MAGIC_5000: i64 = 5000 |
| 13 | const PD_METRICS: *u8 = "knowledge/status/apm_metrics.tsv" |
| 14 | const PD_QUEUE: *u8 = "knowledge/publish/recovery_queue.tsv" |
| 15 | const PD_LEDGER: *u8 = "knowledge/publish/recovery_ledger.tsv" |
| 16 | const PD_MAP: *u8 = "knowledge/publish/recover_map.tsv" |
functions
| 18 | func pulsed_run(interval_sec: i64, max_cycles: i64, collector_elf: *u8, metrics: *u8, queue: *u8, ledger: *u8, map: *u8) -> i64 |
| 39 | func 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 |
| 40 | func 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 } |
| 41 | func main(argc: i64, argv: *i64) -> i64 |