Gatling JavaScript and Typescript DSL.
jvm
: sbt projectjvm/adapter
: Java code used by gatling-jsjvm/java2ts
: TypeScript interfaces generation from Java code (used internally in gatling-js), see gatling/java2typescript for our fork of java2typescript, used here
js
: npm project with multiple workspaces for the different components of gatling-jsjs/cli
: CLI tool used by an end user to build/run/package gatling-js projectsjs/jvm-types
: generated TypesSript interfaces for Gatling Java (generated fromjvm/java2ts
)js/core
: Gatling Core modulejs/http
: Gatling HTTP module
js-simulation
: sample JavaScript simulationts-simulation
: sample TypeScript simulation
Also:
tmp
: where we copy npm packages to link to them from the sample simulation (see "Run the sample simulation locally" below).~/.gatling
: home directory for the CLI tool, where it downloads GraalVM and Coursier.
Code generated in jvm/java2ts
needs to be copied to js/jvm-types
(just use the script ./regen-java2ts.sh
to generate, copy, format, and compile the code).
For local development: JDK 21+, sbt, a recent version of node. To run a JS simulation using published artifacts: a recent version of node.
This setup uses npm link
to link the sample simulation project to locally built npm dependencies rather than downloading them from an npm registry.
TL;DR:
- Install everything with
./install-all-with-links.sh
, which:- publishes
/jvm/adapter
to your local repo - installs and builds the npm workspaces in
js
(note: the npm packages get copied totmp
) - installs and builds
js-simulation
- publishes
- (When you change code in
jvm/adapter
orjs
, you can just rebuild everything with./build-all.sh
) - Run the sample simulation:
cd js-simulation npm run start
Examples:
- format code in all workspaces:
npm run format --workspaces
- format code only in the core workspace:
npm run format --workspace=core
Configure the version of the @gatling.io
dependencies in /js-simulation
or /ts-simulation
. Then:
npm install
npm run start
Read the documentation.
Join the Gatling Community Forum.
Found a real bug? Raise an issue.