code wiki / (root) / nx_load_test_harness.nx

nx_load_test_harness.nx

buildroot/runtime/nx_load_test_harness.nx

8898 B186 linesdepth 22pulls 131 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_load_test_harness.nx -- N-concurrent-user capacity probe. module: nishi-core.perception.load_test_harness depends: nishi-core.perception.profile + nishi-core.perception.external_reach_probe + nishi-core.perception.perceptual_dataset + nishi-core.net.socket + nishi-core.io.syscalls disk_kb: 5 capability: PERCEPTION wired_status: PARTIAL_WIRED MISSING_CAPABILITIES: - CONCURRENT_CONNECT_DISPATCH (issue N parallel TCP+TLS+HTTP connects via nx_socket + nx_tls13_client + nx_https_client; all FULLY_WIRED; wire the call site through a scheduler that respects nx_cooperative_resource_arbitration budgets) - LATENCY_PERCENTILE_AGGREGATION (p50 / p95 / p99 / pmax + error rate in single pass without buffering all responses) - WS_LOAD_DISPATCH (WebSocket-frames-per-second sustain test for the /video chat substrate specifically) - WEBRTC_PEER_LOAD (simulate N peer mesh connections with SRTP-like payload; gates the family-chat capacity claim) license_tier: PUBLIC_NISHI_SUBSTRATE genealogy_id: feedback-substrate-does-heavy-lifting-user-is-partner-not-gate_2026 + feedback-substrate-primitives-meta-not-one-off_2026 + feedback-real-playtest-loop-not-just-logs + nx_realism_score + NISHIFAMILY_VIDEO_HARDENING_2026-05-20 + wrk_2012_http_benchmarking + vegeta_2013_http_load_testing User directive 2026-05-20: "real heavy heavy testing... how many users can interact well, if it does message spam, all that bullshit." THIS primitive issues N concurrent virtual users against ANY endpoint (HTTP/HTTPS landing page, WebSocket chat frames, simulated WebRTC peer mesh) and reports latency percentiles + error rate + sustained throughput. Distinct from nx_external_reach_probe (which is one probe at a time): this is sustained concurrent load to find the capacity knee.

dependencies 4 imports · 1 importers

nx_syscalls.nx nx_perceptual_profile.nx nx_external_reach_probe.nx nx_perceptual_dataset.nx nx_load_test_harness.nx nx_message_spam_detector.nx

imports: nx_syscalls.nxnx_perceptual_profile.nxnx_external_reach_probe.nxnx_perceptual_dataset.nx

imported by: nx_message_spam_detector.nx

structs

115struct NxLoadTestConfig
130struct NxLoadTestResult

consts

66const NX_LT_PROFILE_HTTP_GET: i64 = 1 // simple GET
67const NX_LT_PROFILE_HTTP_POST: i64 = 2 // form submit / API
68const NX_LT_PROFILE_WS_CHAT_BURST: i64 = 3 // N message frames/sec
69const NX_LT_PROFILE_WS_LONG_LIVED: i64 = 4 // N connections held open
70const NX_LT_PROFILE_WEBRTC_PEER_MESH: i64 = 5 // mesh with N participants
71const NX_LT_PROFILE_FILE_DOWNLOAD: i64 = 6 // N parallel large downloads
72const NX_LT_PROFILE_DNS_QUERY_FLOOD: i64 = 7 // DNS amplification
74const NX_LT_PROFILE_TLS_HANDSHAKE_STORM: i64 = 8 // N TLS handshakes in
94const NX_LT_VERDICT_S_CLASS: i64 = 5 // p99 <= 100 ms, 100% success
95const NX_LT_VERDICT_A_CLASS: i64 = 4 // p99 <= 500 ms
96const NX_LT_VERDICT_B_CLASS: i64 = 3 // p99 <= 2 s
97const NX_LT_VERDICT_C_CLASS: i64 = 2 // p99 <= 5 s
98const NX_LT_VERDICT_D_CLASS: i64 = 1 // p99 <= 30 s
99const NX_LT_VERDICT_F_BROKEN: i64 = 0 // any errors OR p99 > 30s
100const NX_LT_VERDICT_DEPENDENCY_MISSING: i64 = -1 // PARTIAL_WIRED default

functions

77func nx_lt_profile_name(p: i64) -> *u8
102func nx_lt_verdict_name(v: i64) -> *u8
150func nx_load_test_run(config_ptr: *NxLoadTestConfig,
161func nx_load_test_find_capacity_knee(endpoint_url_ptr: *u8, endpoint_url_len: i64,
178func nx_load_test_persist_to_dataset(result_ptr: *NxLoadTestResult) -> i64
184func nx_load_test_get_last_verdict() -> i64