Getting started
Install LoadStride and run your first local HTTP test.
On this page
Your first LoadStride run
LoadStride 0.2.0 supports installation from npm, a source checkout or a local archive.
HTTP testing requires Node.js 20 or newer and no third-party runtime dependencies.
From npm
From your application’s directory:
npm install --save-dev --omit=optional loadstride@0.2.0
npx --no-install loadstride --version
For a local demonstration, start the installed sample target in that directory:
node node_modules/loadstride/starter-kit/server.js
It listens on http://127.0.0.1:3000. In a second terminal, in the same application
directory, write and run your first script.
If port 3000 is occupied, use your own local API and pass its URL with --url.
The npm shortcuts in the source-checkout instructions belong to the LoadStride
repository, not to your application’s package.json. Installed users run the
npx --no-install loadstride commands shown here.
From the source checkout
Open a terminal in the LoadStride directory and start the included local target:
npm run demo:server
The target listens on http://127.0.0.1:3000. If that port is occupied, use your
own local API and pass its URL with --url in the next command.
In a second terminal, in the same directory:
node bin/loadstride.js run starter-kit/basic.js --no-env --url http://127.0.0.1:3000 --vus 2 --iterations 10 --report-dir reports/first-run
npm run report:serve
Open http://127.0.0.1:8080, expand the newest saved date, and follow the HTML link.
The console prints the exact JSON/HTML paths as well. Use a different report-server
port with npm run report:serve -- --port 8081 if necessary.
The included target should produce ten successful requests and passing checks.
Two VUs means at most two concurrent iterations; ten iterations is the total
across both users. The script makes one request per iteration. --no-env skips
local .env files; CLI settings override matching shell configuration.
Stop the target and report server with Ctrl+C when finished.
HTTP mode needs no npm install in this checkout. Optional browser setup is
separate and requires Playwright, Acorn and Chromium; see the
browser instructions.
From a locally built package
Maintainers can run an automated clean-install check:
npm run package:check
This builds a tarball into temporary storage, checks its file list, installs it offline into an empty project without optional peers, verifies the installed CLI, runs a passing HTTP test and an intentionally failing threshold, and checks report hosting. It cleans up its servers and temporary files. It does not publish.
For a manual trial, build an archive in the source checkout:
npm pack
The resulting filename includes the current version, for example
loadstride-0.2.0.tgz. In your own application directory:
npm install --save-dev --omit=optional /absolute/path/to/loadstride-0.2.0.tgz
Write and run your first script
After npm or local-archive installation, create checkout.mjs in your application
directory:
export const options = {
vus: 2,
iterations: 10,
thresholds: {
checks: ['rate==1'],
http_req_failed: ['rate==0'],
},
};
export default async function ({ http, check }) {
const response = await http.get(process.env.TARGET_URL ?? 'http://127.0.0.1:3000');
check(response, { 'HTTP 200': r => r.status === 200 && !r.error });
}
With your local target still running:
npx --no-install loadstride run checkout.mjs --no-env --url http://127.0.0.1:3000 --report-dir reports/checkout
npx --no-install loadstride report serve reports
Both commands run from your application’s directory. You can place scripts elsewhere and select another report root independently. Results are saved in unique run folders and discovered recursively. For shared results, see the report-server guide.
Interpret the result
- Exit
0: the run passed. Exit1: a threshold or iteration failed. Exit2: configuration error. Exit130: interrupted. - A successful request does not prove business success; add assertions for your application’s response data and thresholds for the behavior you care about.
- Inspect failed requests, checks, dropped iterations and generator pressure alongside latency percentiles. Requested load may exceed the generator’s capacity.
- Reports contain endpoint labels and error samples. Remove credentials and private data before sharing results or attaching them to an issue.
For feedback, use the repository’s Preview feedback issue template. Include your Node/OS versions, installation method, first-run outcome, the task you tried, and the step that caused the most difficulty. Browser mode currently supports fixed VUs only and one workload, with a configurable ceiling that defaults to 20 VUs. Use browser calibration to measure higher levels. Distributed workers, streaming exporters and automatic correlation remain future work.
Based on the released v0.2.0 guide. View source on GitHub.