code wiki / _hdl_build / nx_apm_collect_gate.nx

nx_apm_collect_gate.nx

buildroot/runtime/_hdl_build/nx_apm_collect_gate.nx

6271 B103 linesdepth 6pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic apm
docsdependenciesstructsconstsfunctions

about

nx_apm_collect_gate.nx -- SOVEREIGN gate for the internal-HTTP APM collector. Spawns real mock daemons (nx_apm_mock, self-terminating) on loopback and proves ac_burst's four verdicts against ground truth -- each test prints its MEASURED numbers (no overclaim: the operator reads the raw stats, not a curated "GREEN"): T1 NEGATIVE CONTROL -- a healthy fast daemon must be GREEN, fully served, nothing flagged. T2 DETECTION -- a daemon that SERIALIZES (300ms/req) must, under 8 concurrent probes, show a stall and max >= ~2400ms = the "tabs don't load" wedge, caught. T3 LIAR-KILL -- an ABSENT daemon (no listener) must be DOWN with oks=0, never GREEN. T4 GRACEFUL DEGRADE -- a daemon slower than the probe timeout must time out (~1s) not hang forever. T5 ARTIFACT-IMMUNITY -- a daemon that sends FAST then HOLDS the socket open (keep-alive/idle) must be GREEN (ttfb fast) with slowclose>0 -- NOT a false wedge. This is THE fix: the live :8791/vroom "20s" was exactly this (ttfb~0, total~20-25s), an artifact. Requires /tmp/nx_apm_mock.sov.elf built first. Per-test reap; no kill primitive needed. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_apm_collect.nx nx_apm_collect_gate.nx

imports: nx_syscalls.nxnx_apm_collect.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real ge_spawn_mock sys_fork sys_mmap ↻ ge_itoa sys_mmap ↻ ac_n sys_mmap ↻ sys_execve sys_exit sys_sleep_ms sys_mmap ↻ sys_munmap ac_burst sys_mmap_shared sys_mmap ↻ sys_fork ↻ ac_probe sys_now_ms sys_mmap ↻ sys_clock_gettime_mono sys_socket sys_set_socket_timeout sys_mmap ↻ sys_setsockopt sys_munmap ↻ sys_mmap ↻ ac_addr nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll sys_close ac_build_get ac_s

structs

none

consts

19const GE_MOCK: *u8 = "_offc/nx_apm_mock.elf"

functions

21func ge_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
22func ge_wn(v: i64) -> i64 { let b: *u8 = sys_mmap(24); let e: i64 = ac_n(b, 0, v); sys_write(1, b, e); return 0 }
called by 1: main calls 3: sys_mmapac_nsys_write
23func ge_itoa(v: i64) -> *u8 { let b: *u8 = sys_mmap(24); let e: i64 = ac_n(b, 0, v); b[e] = 0 as u8; return b }
called by 1: ge_spawn_mock calls 2: sys_mmapac_n
26func ge_spawn_mock(port: i64, delay: i64, hold: i64, maxr: i64) -> i64
42func main(argc: i64, argv: *i64) -> i64