Git Product home page Git Product logo

load-test's Introduction

load-test

The SearchAPI uses Gatling to executes load tests.

Setup

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.

How To Build

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.

How To Run

Gatling works with a Simulation concept and for SearchAPI we creates the SearchAPIv2Simulation.

There some steps when you run the load tests:

  1. If not already built, builds and runs load-test docker image.
  2. Executes your simulations.
  3. Uploads you simulation report on Amazon S3.
  4. 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.

Local

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>"

Kubernetes

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.

Running with Gradle

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

How to Test

No tests currently implemented

How To Deploy

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.

Creating your own Simulation

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"

Simple Request Simularion

It's a Simulation that downloads a csv file from Graylog API based on a query and executes the resulting URIs requests in circle and during a configured time.

Configuration

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.