code wiki / _hdl_build / nx_netobs.nx
nx_netobs.nx
buildroot/runtime/_hdl_build/nx_netobs.nx
about
nx_netobs.nx -- SOVEREIGN NET/HOST OBSERVABILITY + CLOSED-LOOP BENCH (operator 2026-07-20: "make sure
our networking and hosting is state of the art ... sovereign version of the Prometheus/Telegraf/
Grafana/k6/analyzer stack, largest rock down"). One drift-immune organ (imports ONLY nx_syscalls):
(no-arg|beat) clock-beat: 2s-window host counters (/proc: cpu,mem,load,net,tcp-snmp) + per-service
loopback latency probes (manifest-driven) -> METRIC rows (ledger, rotated) -> page.
burst <n> <ms> high-frequency sampler (operator's sub-second ask, bounded envelope) -> same series.
page emit sites/nishifamily/netobs.html: CORRELATIVE aligned-timeline SVG rows (Grafana role).
bench <conc> <total> <port> <path> sovereign loadgen (k6 role): fork workers, loopback-ONLY by
construction, p50/p90/p95/p99 percentiles + rps -> ledger + netobs_bench.log.
verdict analyzer (closed-loop brain): thresholds from knowledge/registry/netobs_thresholds.tsv
(rule 11: NO magic numbers in code) vs latest ledger samples -> netobs_gate.log
VERDICT=GREEN|RED (deploy_ready/cron_watch evidence-pointer format).
selftest KAT teeth (cpu-parse bounds, percentile KAT, ledger roundtrip, probe).
Ledger: knowledge/status/netobs_metrics.log, METRIC line protocol (contract-compatible with
nx_metric_ledger; ADDITIVE ts=<epoch> field). Rotation at 3MiB -> .1 (bounded, declared).
Rule 26: ZERO hardware writes -- /proc,/sys READS only; tuning half emits RECOMMENDATIONS, never sysctl.
Envelopes DECLARED IN OUTPUT (scale law): beat=2s-window, probes<=16, probe-timeout=5s, page=12h/720pt,
bench conc<=64 total<=100000 loopback-only, burst n<=600 ms>=200, ledger-rot=3MiB.
CONFIG = SOVEREIGN SEG-STORE PLANES (no-tsv law, operator emphatic 2026-06-21/07-20): probes + thresholds
live in knowledge/store/netobs-probes- / netobs-thresholds- (read via sts_load = the canonical store-seed
codec); `seedcfg` migrates the retired .tsv in one-time; a .tsv read remains ONLY as a zero-downtime fallback.
license_tier: ORIGINAL expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_sovjson_lib.nxnx_connect.nxnx_syscalls.nxnx_store_seed_lib.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
| 27 | const NO_MAGIC_65536: i64 = 65536 |
| 28 | const NO_MAGIC_65535: i64 = 65535 |
| 29 | const NO_MAGIC_1024: i64 = 1024 |
| 30 | const NO_MAGIC_2000: i64 = 2000 |
| 31 | const NO_MAGIC_131072: i64 = 131072 |
| 32 | const NO_MAGIC_1048576: i64 = 1048576 |
| 33 | const NO_MAGIC_65000: i64 = 65000 |
| 34 | const NO_MAGIC_2097152: i64 = 2097152 |
| 35 | const NO_MAGIC_2097151: i64 = 2097151 |
| 36 | const NO_MAGIC_1000000000: i64 = 1000000000 |
| 37 | const NO_MAGIC_50000: i64 = 50000 |
| 38 | const NO_MAGIC_4096: i64 = 4096 |
| 39 | const NO_MAGIC_7777: i64 = 7777 |
| 40 | const NO_MAGIC_1111: i64 = 1111 |
| 41 | const NO_MAGIC_8888: i64 = 8888 |
| 42 | const NO_MAGIC_2222: i64 = 2222 |
| 43 | const NO_MAGIC_4095: i64 = 4095 |
| 44 | const NO_MAGIC_8443: i64 = 8443 |
| 45 | const NO_MAGIC_18090: i64 = 18090 |
| 47 | const NO_CAP: i64 = 4194304 |
| 48 | const NO_ROT: i64 = 3145728 |
| 49 | const NO_WIN: i64 = 43200 |
| 50 | const NO_PTS: i64 = 720 |
| 51 | const NO_PROBES_MAX: i64 = 16 |
| 52 | const NO_BENCH_CONC_MAX: i64 = 64 |
| 53 | const NO_BENCH_TOTAL_MAX: i64 = 100000 |
| 54 | const NO_BURST_N_MAX: i64 = 600 |
| 55 | const NO_BURST_MS_MIN: i64 = 200 |
| 56 | const NO_DRAIN_CAP: i64 = 262144 |
| 57 | const NO_TMO_S: i64 = 5 |
functions
| 59 | func no_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 60 | func no_w(s: *u8) -> i64 { let n: i64 = no_len(s); sys_write(1, s, n); return 0 } |
| 61 | func no_cat(d: *u8, o: i64, s: *u8) -> i64 { return sj_cat(d, o, s) } |
| 62 | func no_catn(d: *u8, o: i64, v: i64) -> i64 { return sj_catn(d, o, v) } |
| 63 | func no_wn(v: i64) -> i64 { let b: *u8 = sys_mmap(32); let o: i64 = no_catn(b, 0, v); sys_write(1, b, o); return 0 } |
| 64 | func no_eq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; var g: i64 = 1; var r: i64 = 1; while g == 1 { if a[i] != b[i] { r = 0; g = 0 } else { if a[i] == (0 as u8) { g = 0 } else { i = i + 1 } } } return r } called by 1: main |
| 65 | func no_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 |
| 66 | func no_read(path: *u8, buf: *u8, cap: i64) -> i64 called by 11: no_load_cfgno_cpuno_mem_avail_mbno_load_millino_netdevno_snmp+5 calls 3: sys_openat_rdsys_readsys_close |
| 76 | func no_load_cfg(plane: *u8, tsv: *u8, buf: *u8, cap: i64) -> i64 |
| 81 | func no_wfd(fd: i64, buf: *u8, n: i64) -> i64 { var w: i64 = 0; while w < n { let src: *u8 = ((buf as i64) + w) as *u8; let r: i64 = sys_write(fd, src, n - w); if r <= 0 { w = n } else { w = w + r } } return 0 } |
| 83 | func no_atomic(path: *u8, buf: *u8, n: i64) -> i64 |
| 96 | func no_append(path: *u8, buf: *u8, n: i64) -> i64 |
| 104 | func no_fsize(path: *u8) -> i64 |
| 112 | func no_num_after(buf: *u8, n: i64, marker: *u8) -> i64 |
| 134 | func no_line_end(q: *u8, i: i64, n: i64) -> i64 { var e: i64 = i; var s: i64 = 1; while s == 1 { if e >= n { s = 0 } else { if q[e] == (10 as u8) { s = 0 } else { e = e + 1 } } } return e } |
| 136 | func no_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64 |
| 152 | func no_cstr(q: *u8, s: i64, e: i64, dst: *u8) -> i64 { var i: i64 = 0; while s + i < e { dst[i] = q[s+i]; i = i + 1 } dst[i] = 0 as u8; return i } |
| 153 | func no_span_atoi(q: *u8, s: i64, e: i64) -> i64 { var v: i64 = 0; var i: i64 = s; while i < e { let c: i64 = q[i] as i64; if c >= 48 { if c <= 57 { v = v * 10 + (c - 48) } } i = i + 1 } return v } |
| 155 | func no_tokn(q: *u8, p0: i64, le: i64, nth: i64) -> i64 |
| 177 | func no_cpu(out: *i64) -> i64 |
| 204 | func no_mem_avail_mb() -> i64 |
| 212 | func no_load_milli() -> i64 |
| 225 | func no_netdev(out: *i64) -> i64 |
| 261 | func no_snmp(out: *i64) -> i64 |
| 310 | func no_probe(port: i64, path: *u8, mode: i64, out: *i64, scr: *u8) -> i64 |
| 352 | func no_req(port: i64, path: *u8, scr: *u8) -> i64 |
| 363 | func no_mrow(lb: *u8, o: i64, name: *u8, tu: i64, ts: i64, val: i64, unit: *u8) -> i64 |
| 378 | func no_last(buf: *u8, n: i64, name: *u8, out: *i64) -> i64 |
| 406 | func no_series(buf: *u8, n: i64, name: *u8, ts0: i64, xs: *i64, ys: *i64, maxp: i64) -> i64 |
| 447 | func no_sift(a: *i64, n: i64, i0: i64) -> i64 called by 1: no_sort |
| 460 | func no_sort(a: *i64, n: i64) -> i64 |
| 468 | func no_pct(a: *i64, n: i64, p: i64) -> i64 { if n <= 0 { return 0 - 1 } let ix: i64 = ((n - 1) * p) / 100; return a[ix] } |
| 471 | func no_beat(do_page: i64) -> i64 |
| 597 | func no_burst(n: i64, ms: i64) -> i64 |
| 656 | func no_svg_series(pg: *u8, po: i64, buf: *u8, n: i64, name: *u8, unit: *u8, ts0: i64, tsN: i64) -> i64 |
| 698 | func no_page() -> i64 |
| 773 | func no_bench_run(conc: i64, total: i64, port: i64, path: *u8, res: *i64) -> i64 |
| 880 | func no_ramp(port: i64, path: *u8, target_us: i64) -> i64 |
| 966 | func no_bench(conc: i64, total: i64, port: i64, path: *u8) -> i64 |
| 1025 | func no_verdict() -> i64 |
| 1092 | func no_selftest() -> i64 |
| 1142 | func no_seedcfg() -> i64 |
| 1169 | func main(argc: i64, argv: *i64) -> i64 |