/gatling-kotlin-example

An example Gatling Maven project using Kotlin DSL.

Primary LanguageKotlinApache License 2.0Apache-2.0

gatling-kotlin-example

Build

An example Gatling Maven project using Java DSL.

Requirements

  • Java 21

Building

./mvnw clean package

Running

Using the executable jar file (run-simulation-using-jar.sh):

JAVA_OPTS="-DbaseUrl=http://localhost:8080  -DdurationMin=1 -DrequestPerSecond=10"
SIMULATION_NAME=gatling.test.example.simulation.ExampleSimulation
java ${JAVA_OPTS} -cp target/gatling-kotlin-example.jar io.gatling.app.Gatling --simulation "${SIMULATION_NAME}" --results-folder results

Using the Gatling Maven plugin (run-simulation-using-plugin.sh):

./mvnw -DsimulationClass=gatling.test.example.simulation.ExampleSimulation gatling:test

Using the Docker container (run-simulation-using-docker.sh):

./mvnw clean package
docker build -t gatling-kotlin-example:main .
docker run -e "JAVA_OPTS=-DbaseUrl=http://some-target-host:8080 -DdurationMin=1 -DrequestPerSecond=10" \
-e SIMULATION_NAME=gatling.test.example.simulation.ExampleSimulation gatling-kotlin-example:main

As Kubernetes Job:

  • Ensure you have Helm installed and can deploy to a Kubernetes cluster locally.
cd deployment/k8s/helm
make package install