Giter Site home page Giter Site logo

nejckorasa / locust4j-http-load Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 2.0 50 KB

Locust4j Http Load example project

Java 47.99% Kotlin 44.33% Shell 3.48% Dockerfile 3.11% Python 1.10%
performance-testing locust locustio http-benchmarking benchmark benchmark-framework benchmarking http-testing http-load-testing performance-test

locust4j-http-load's Introduction

Tweet

Locust4j http load

An example project for http load testing using locust4j, written in Java and Kotlin.

This is not a library of any sort, just an example on how to use Locust and Locust4j to write load tests for more complex scenarios (dependent subsequent requests, ...)

Inspired by/based on locust4j-http

Build & Run

App acts as Locust slave that connects to Locust master, hence you need to also run master.

Run slave

  • Build and package with Maven:
$ git clone https://github.com/nejckorasa/locust4j-http-load
$ cd locust4j-http-load
$ mvn package
  • Run jar:
$ java -jar locust4j-load-http-1.0-SNAPSHOT-fat.jar

Jar accepts arguments to configure Locust, see ConfigurationContext.

Run master (Bash)

You can run master using bash scripts in master-bash directory.

See the scripts for more configuration options.

Run master (Docker)

Run Locust master in Docker, see master-docker directory.

Build image:

$ docker build -t master-locust .

Run with web:

$ docker run --rm --name master-locust -p 8089:8089 -p 5557:5557 -p 5558:5558 master-locust \
    --master \
    --master-bind-port=5557

Run with no-web (for 180s):

$ docker run --rm --name master-locust -p 8089:8089 -p 5557:5557 -p 5558:5558 -v $PWD:/locust master-locust \
    --master \
    --master-bind-port=5557 \
    --run-time=180s \
    --clients=10 \
    --hatch-rate=1 \
    --no-web \
    --print-stats \
    --expect-slaves=1 \
    --csv-base-name=example

Write your own task objects

See GetExampleTask and PostExampleTask for examples

Http

Http requests are made using HttpRequests, with options to record or not record the request with Locust.

locust4j-http-load's People

Contributors

dependabot[bot] avatar nejckorasa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.