/base-performance-testing-gatling

Basic performance testing using Gatling

Primary LanguageJavaMIT LicenseMIT

Performance testing using Gatling with Java and Scala

This project is an example of the different types of performance tests that are described in Performance testing summary using Gatling and Docker compose.

Table of contents

Get Started

Requirements

Configuration

Setup environment (start mockoon server) using docker compose:

docker compose --profile env up --detach

Run performance testing

Implementation of "Case 1: Load testing" using Java

Run

Set GATLING_SIMULATION=load/java in .env file:

sed -i 's/\(GATLING_SIMULATION=\).\+/\1load\/java/' .env

Run load testing with 10 runners:

docker compose --profile test up --scale worker=10

Result

Load testing result

Implementation of "Case 1: Load testing" using Scala

Run

Set GATLING_SIMULATION=load/scala in .env file:

sed -i 's/\(GATLING_SIMULATION=\).\+/\1load\/scala/' .env

Run load testing with 10 runners:

docker compose --profile test up --scale worker=10

Result

Load testing result

Implementation of "Case 2: Stress testing" using Java

Run

Set GATLING_SIMULATION=stress/java in .env file:

sed -i 's/\(GATLING_SIMULATION=\).\+/\1stress\/java/' .env

Run stress testing with 10 runners:

docker compose --profile test up --scale worker=10

Result

Stress testing result

Implementation of "Case 2: Stress testing" using Scala

Run

Set GATLING_SIMULATION=stress/scala in .env file:

sed -i 's/\(GATLING_SIMULATION=\).\+/\1stress\/scala/' .env

Run stress testing with 10 runners:

docker compose --profile test up --scale worker=10

Result

Stress testing result

Implementation of "Case 3: Soak testing" using Java

Run

Set GATLING_SIMULATION=soak/java in .env file:

sed -i 's/\(GATLING_SIMULATION=\).\+/\1soak\/java/' .env

Run soak testing with 10 runners:

docker compose --profile test up --scale worker=10

Result

Soak testing result

Implementation of "Case 3: Soak testing" using Scala

Run

Set GATLING_SIMULATION=soak/scala in .env file:

sed -i 's/\(GATLING_SIMULATION=\).\+/\1soak\/scala/' .env

Run soak testing with 10 runners:

docker compose --profile test up --scale worker=10

Result

Soak testing result

Implementation of "Case 4: Spike testing" using Java

Run

Set GATLING_SIMULATION=spike/java in .env file:

sed -i 's/\(GATLING_SIMULATION=\).\+/\1spike\/java/' .env

Run spike testing with 10 runners:

docker compose --profile test up --scale worker=10

Result

Spike testing result

Implementation of "Case 4: Spike testing" using Scala

Run

Set GATLING_SIMULATION=spike/scala in .env file:

sed -i 's/\(GATLING_SIMULATION=\).\+/\1spike\/scala/' .env

Run spike testing with 10 runners:

docker compose --profile test up --scale worker=10

Result

Spike testing result

Clean environment

docker compose --profile env --profile test down

License

MIT