Help us shape the future of Go! Take the 2026 Go Developer Survey

loadtest

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Command loadtest is the concurrent-load + latency benchmark harness. A p50/p95 measured one request at a time against a localhost upstream says nothing about contention; this drives N concurrent sessions (distinct delegated users, each minting its own root capability), each firing a burst of real HTTP tool calls at the actual running proxy, with real client-observed latency recorded - not simulated, not mocked.

It also exists to answer a second, more honest question than "is the proxy fast": how much does the proxy ITSELF add on top of whatever the real upstream enterprise API already takes to respond? cmd/mockupstream can simulate realistic upstream latency via MOCK_UPSTREAM_LATENCY_MS - run this harness once with that unset (0ms, isolates proxy overhead) and once with it set to something like 30-50ms (a realistic same-region API call), and compare GET /metrics' per-stage breakdown between runs. Proxy overhead (validate+policy+capability, excluding upstream_call) should stay essentially flat across both - if it doesn't, the proxy is adding hidden cost that scales with something it shouldn't.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL