code wiki / _hdl_build / nx_apm_collect_gate.nx
nx_apm_collect_gate.nx
buildroot/runtime/_hdl_build/nx_apm_collect_gate.nx
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
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
structs
| none |
consts
| 19 | const GE_MOCK: *u8 = "_offc/nx_apm_mock.elf" |
functions
| 21 | func 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 } |
| 22 | func 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 } |
| 23 | func 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 } |
| 26 | func ge_spawn_mock(port: i64, delay: i64, hold: i64, maxr: i64) -> i64 |
| 42 | func main(argc: i64, argv: *i64) -> i64 |