Skip to content

An example Gatling Maven project using Java DSL

License

Notifications You must be signed in to change notification settings

venkata-qa/gatling-java-example

 
 

Repository files navigation

gatling-java-example

Build and Push

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-java-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-java-example:main .
docker run -e "JAVA_OPTS=-DbaseUrl=http://localhost:8080 -DdurationMin=1 -DrequestPerSecond=10" \
-e SIMULATION_NAME=gatling.test.example.simulation.ExampleSimulation gatling-java-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

About

An example Gatling Maven project using Java DSL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 31.3%
  • Shell 22.2%
  • Smarty 20.4%
  • Makefile 11.0%
  • JavaScript 9.9%
  • Dockerfile 5.2%