code wiki / _hdl_build / nx_apm_pulse.nx

nx_apm_pulse.nx

buildroot/runtime/_hdl_build/nx_apm_pulse.nx

3334 B65 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic apm
docsdependenciesstructsconstsfunctions

about

nx_apm_pulse.nx -- SOVEREIGN active-monitoring cadence ("the New-Relic heartbeat"). Each cycle it runs the collector (probe daemons -> append apm_collect.tsv) then the dashboard (regen apm_dashboard.html), prints a heartbeat, and sleeps `interval` seconds. Thin orchestrator over two already-gated organs (nx_apm_collect 5/5, nx_apm_dashboard 5/5) -- it sequences them on a timer; cycles=0 runs forever. usage: nx_apm_pulse [interval_sec=30] [cycles=0(forever)] [ip=127.0.0.1] [collector_elf] [dashboard_elf] ip=127.0.0.1 on the NAS (loopback) OR a.b.c.d to monitor over LAN. Run with CWD=nxc2 so the organs' relative knowledge/status/ paths resolve. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_apm_pulse.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main ap_atoi ap_w sys_write ap_slen ap_wn sys_mmap sys_write ↻ ap_run sys_fork sys_mmap ↻ sys_execve sys_exit sys_wait4 sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_sleep_ms sys_mmap ↻ sys_munmap

structs

none

consts

11const AP_COLLECT: *u8 = "_offc/nx_apm_collect.elf"
12const AP_DASH: *u8 = "_offc/nx_apm_dashboard.elf"

functions

14func ap_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: ap_w
15func ap_w(s: *u8) -> i64 { return sys_write(1, s, ap_slen(s)) }
called by 1: main calls 2: sys_writeap_slen
16func ap_wn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
23func ap_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
26func ap_run(elf: *u8, arg1: *u8) -> i64
39func main(argc: i64, argv: *i64) -> i64