The SearchAPI uses Gatling to executes load tests.
The application.conf file that provides all configuration to load tests.
You can override each config above using Java property. For example, if you can override gatling.users
property you must use -Dgatling.users=<value>
.
For more details about how to do override, see How To Run section.
To build this project, you need to execute these commands:
git submodule update --init --recursive
make build
The vivareal/load-test:load-test
docker image will be created.
Gatling works with a Simulation concept and for SearchAPI we creates the SearchAPIv2Simulation.
There some steps when you run the load tests:
- If not already built, builds and runs
load-test
docker image. - Executes your simulations.
- Uploads you simulation report on Amazon S3.
- Notifies report status on Slack with link to access them.
There are two parameters to use:
-
LT_ENDPOINT
*: load tests target endpoint. -
LT_EXTRA_ARGS
: gatling extra args
The environment variables with *
are required. You can override each config using LT_EXTRA_ARGS
.
To run local, you simple use make run-local
with the target ip to load test, for example:
make run-local LT_ENDPOINT="<TARGET_IP>"
To run using Kubernetes, you simple use make run
:
make run LT_ENDPOINT="<TARGET_IP>"
Yon can use K8S_RUN_ARGS
to configure kubectl run params.
To run using Gradle too and you simple use gatlingRun
task.
./gradlew gatlinRun
The upload and notification process is separated and to do this you must use uploadReport
.
./gradlew gatlinRun uploadReport
No tests currently implemented
load-test is a tool/lib project and the deploy is subjective according to the project that uses.
You may use docker to deploy: make push
To push successful docker image, make sure you setup docker credentials.
Just implement the simulation in package com.vivareal.search.simulation
and sent it in gatling.simulations.include
parameter:
./gradlew gatlingRun -Dscenario.users=1 -Dgatling.rampUp=30 -Dgatling.maxDuration=60 -Dgatling.simulations.include=**/SimpleRequestSimulation.scala
Or you can send it in LT_EXTRA_ARGS
:
make run LT_EXTRA_ARGS="-Dgatling.simulations.include=**/SimpleRequestSimulation.scala"
It's a Simulation
that downloads a csv
file from Graylog
API based on a query and executes the resulting URI
s requests in circle
and during
a configured time.
Param | Description | Example |
---|---|---|
graylog.query | Graylog query to fetch URIs | application:cloudflare |
graylog.urisFile | file name to save the Graylog API result | uris.csv |
graylog.uriField | the field name of the csv file generated by Graylog API | ClientRequestURI |
graylog.authorization | Graylog API encoded basic auth header | Basic LALALALA |
graylog.range | Time range in seconds for Graylog query | 300 |
graylog.limit | Limit of the results for Graylog query | 5000 |
All above params can be overriden using System Properties.