Skip to main content

HAR-based load testing CLI for jac-scale applications

Project description

jac-loadtest

HAR-based load testing CLI for jac-scale applications. Capture real browser traffic via Chrome DevTools, export it as a .har file, and replay it under load — no scripting required.

The tool registers itself as a jac subcommand, so after installation you run jac loadtest alongside jac start, jac deploy, and the rest of the jac ecosystem.

Testing Modes

Monolith mode (default) — all requests go through a single --url. Use this for production-realistic load testing: it measures what users actually experience end-to-end through the gateway.

Microservice mode — route requests directly to individual service processes by URL path prefix. Use this locally or inside your cluster to isolate per-service latency and identify which service is the bottleneck — without gateway overhead masking the signal.

# Monolith: all traffic through the gateway (default, production-realistic)
jac loadtest recording.har --url http://localhost:8000 --vus 10 --duration 30s

# Microservice: bypass gateway, route by path prefix to individual services
jac loadtest recording.har --mode microservice \
  --url http://localhost:8000 \
  --services-map '{"order_service":"http://localhost:18001","inventory_service":"http://localhost:18002"}' \
  --vus 10 --duration 30s

Note: Microservice mode requires direct network access to service ports. This means it's only usable locally (jac serve) or from inside a Kubernetes cluster — not from outside production. For remote or production load testing, use monolith mode.

Quick Start

# Minimal: 1 VU, 30s
jac loadtest recording.har --url http://localhost:8000

# 50 VUs with 10s ramp-up
jac loadtest recording.har --url http://localhost:8000 --vus 50 --ramp-up 10s --duration 60s

# Authenticated test with per-VU credentials
jac loadtest recording.har --url http://localhost:8000 --vus 20 --credentials-file creds.csv

# CI-friendly with thresholds
jac loadtest recording.har --url http://localhost:8000 \
  --vus 10 --duration 30s --fail-on-p95 500 --fail-on-error-rate 1

Developer Setup

# 1. Create and activate a conda env (Python 3.12 required)
conda create -n load python=3.12
conda activate load

# 2. Install the package in editable mode (runtime deps only)
pip install -e .

# 3. Also install test dependencies (when running tests)
pip install -e ".[test]"

# 4. Verify the command is registered
jac loadtest --help

Project Layout

jac_loadtest/
├── plugin.py      — registers `jac loadtest` via jaclang entry-points
├── cli.py         — argument wiring; JacMetaImporter bootstrap
├── config.py      — LoadTestConfig dataclass (three-layer resolution)
├── core/          — HAR parser, load engine, metrics (no jac-scale knowledge)
├── bridge/        — jac-scale-aware adapters (auth, topology)
└── output/        — console, JSON, HTML reporters

The hard boundary between core/ and bridge/ is what keeps the eventual migration to jac-scale[loadtest] a file move rather than a rewrite.

HAR Compatibility

Tested with HAR 1.1 and 1.2 (the format exported by Chrome DevTools, Firefox, Postman, and Insomnia). Files from other versions are parsed with a warning — open an issue if something breaks.

Documentation

  • Architecture — module map, data flow, design decisions
  • Roadmap — delivery phases and exit criteria
  • Verification — phase-by-phase manual and automated verification checklists

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jac_loadtest-0.2.1.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jac_loadtest-0.2.1-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file jac_loadtest-0.2.1.tar.gz.

File metadata

  • Download URL: jac_loadtest-0.2.1.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for jac_loadtest-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d6554e3e8a414722d0945d6c8f55980d7678b33764399ee6c314329f41e1b87e
MD5 eb49d829833d58ab80f6d3b6f1df5573
BLAKE2b-256 271b4f8b05e6cd60e08925bcd40935a7e221fca3ff2f4428a9144c8707390188

See more details on using hashes here.

File details

Details for the file jac_loadtest-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: jac_loadtest-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for jac_loadtest-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 118136b11b2614728acefe908b76211ffc29abfd65ac7a05ff1d748214bfd48b
MD5 80e819b8c216ddac6abad6c4b76d5826
BLAKE2b-256 ab9f3aca2fd72b24818e59d0cd4c475118805bd9c702ac9163f77413691eac0f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page