GithubHelp home page GithubHelp logo

distributed-load-test-jmeter-docker's Introduction

Documentation

docker-jmeter

As you see in the above JMeter architecture (master, slaves), through this documentation we will learn how to implement this architecture or(how to build your infrastructure using docker) into JMeter using docker to do distributed load testing using docker.

Steps

  • 1- ensure the docker engine is successfully installed on your local machine
  • 2- Run the below commands consecutively.
docker run -dit --name slave01 vinsdocker/jmserver:latest /bin/bash
docker run -dit --name slave02 vinsdocker/jmserver:latest /bin/bash
docker run -dit --name slave03 vinsdocker/jmserver:latest /bin/bash
.
.

The docker engine will pull the images from docker hub and create an n container based on your test design if you wanna do load testing with 3 concurrent users so you should write the above commands 3 times and so on.

  • 3- Run the below command to create a container for JMeter master.
docker run -dit --name master vinsdocker/jmmaster:latest /bin/bash
  • 4- To check if all containers are running successfully, type the below command.
docker ps -a
  • 5- Get the list of IP addresses for the running containers via this command
docker inspect --format '{{ .Name }} => {{ .NetworkSettings.IPAddress }}' $(sudo docker ps -a -q)

the result will be something like the following:

IP address for master/container `172.17.0.2`
IP address for slave01/container `172.17.0.3`
IP address for slave02/container `172.17.0.4`
IP address for slave03/container `172.17.0.5`
  • 6- Copy any files from the local machine to the master container, you can copy your JMeter test script through this command. For ex:
docker exec -i master sh -c "cat > /jmeter/apache-jmeter-5.5/bin/JMeter-test-script.jmx" < JMeter-test-script.jmx
  • 7- Go inside your running master container.
docker exec -it master /bin/bash
  • 8- finally, let's run the test script in master container with passing the IP addresses of the running slaves.
jmeter -n -t /jmeter/apache-jmeter-3.3/bin/JMeter-test-script.jmx -l report/results.csv -f -e -o report/html -R172.17.0.3,172.17.0.4,172.17.0.5,172.17.0.6,172.17.0.7,172.17.0.8,172.17.0.9,172.17.0.10,172.17.0.11,172.17.0.12

Exporting HTML, CSV Report.

  • at the end of the blog you can read and access .html, .csv reports on your local machine through the below command.
docker cp master:/path/report/* ~/Desktop/reporting

distributed-load-test-jmeter-docker's People

Contributors

ahmedmostaffa avatar

Stargazers

 avatar

Watchers

 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.