Getting Started:
This document will help you to review popular open-source performance testing tools such as Jmeter, Locust and Gatling.
We will make live examples on many subjects such as installation and technology, recording scenarios, running tests, test tracking and reporting, logging, resource consumption. Together we will be looking for answers to the questions of which one should we use and when, which one is more suitable for us.
JMETER
Jmeter Requirements:
- Java JRE or JDK Installation (Requires Java 8+)
https://www.oracle.com/tr/java/technologies/javase-downloads.html
- Download the latest release of JMeter (Binaries -> zip extension) and unzip the file.
- Download plugins-manager.jar and put it into JMeter’s lib/ext directory, then restart JMeter.
How to run the Jmeter test with GUI support?
- Start bin/jmeter.sh on MacOS or bin/jmeter.bat file Windows OS.
- Open Jmeter/demoblaze.jmx file from Jmeter GUI
- Use Thread Group to set your virtual user load and test time.
- Start your test and view Test Results on listeners (View Results Tree, Aggregate Graph, …)
How to run Jmeter test from Terminal or Command Prompt?
- Start Terminal or Command Prompt
- Start Jmeter Load Test from Command-line with full paths for jmeter.sh , JMX file and the JTL file for the results. sh /Users/ozgur.kaya/Downloads/apache-jmeter-5.4.1/bin/jmeter -n -t /Users/ozgur.kaya/Downloads/demoblaze.jmx -l /Users/ozgur.kaya/Downloads/jmeterTestResults.jtl
NOTE: If you got some Copy-Paste issues on JMeter please change your Jmeter theme by clicking Options -> Look and Feel -> System
LOCUST
Locust Requirements:
- Install Python 3.6 or later
https://docs.python-guide.org/starting/installation/
- Install locust from terminal
pip3 install locust
- Optionally you need an IDE for the development. We will use Visual Studio Code in this example. Do not forget to install the Python plugin for the VS Code.
How to run the Locust test without a configuration file?
- Open the terminal and navigate to your downloaded Locust/no-config/locustfile.py file. cd /Users/ozgur.kaya/Downloads/Locust/no-config
- Type “locust” and press ENTER.
3. Open your browser and type this URL to visit “http://0.0.0.0:8089/“. Set number of users to 100, set spawn rate to 100 and set the host as “https://www.demoblaze.com/“
4. You can view the test while it’s running.
How to run Locust test with configuration file?
- Open the terminal and navigate to your downloaded Locust/with-config/DemoBlaze.py file. cd /Users/ozgur.kaya/Downloads/Locust/with-config
- Type “locust” and press ENTER. The test will start at that moment. No need to trigger from UI.
- Open your browser and type this URL to visit “http://0.0.0.0:8089/“.
- You can view the test while it’s running.
- You can change the test settings from this downloaded file Locust/with-config/locust.conf
GATLING
Gatling Requirements:
- Install Java JDK
https://www.oracle.com/tr/java/technologies/javase-downloads.html
- Install Brew as described in that URL -> https://brew.sh/
- Install Scala with this command from Terminal brew install scala
- Download Gatling Open-source from this URL. And extract the zipped file on our computer. (“gatling-charts-highcharts-bundle-x.x.x-bundle.zip”) https://gatling.io/open-source/
- Optionally you need an IDE for the development. We will use IntelliJ IDEA in this example. Do not forget to install the Scala plugin for IntelliJ.
https://www.jetbrains.com/idea/download/
How to run the Gatling test from Terminal?
- Copy Gatling/user-files into your gatling-charts-highcharts-bundle-x.x.x-bundle unzipped folder and overwrite them.
- Open the terminal window and navigate to your user-files directory. cd /Users/ozgur.kaya/Downloads/gatling-charts-highcharts-bundle-3.6.1/user-files
- Run the gatling command. sh /Users/ozgur.kaya/Downloads/gatling-charts-highcharts-bundle-3.6.1/bin/gatling.sh
- Choose DemoBlaze as your simulation number. In this example, we will type “0” for this.
- Press ENTER for the run description.
- You can watch your test on the command line while running.
- After the test has been finished You can open index.html file to inspect test results with graphs. Example Path: /Users/ozgur.kaya/Downloads/gatling-charts-highcharts-bundle-3.6.1/results/demoblaze-20211104165049624
Jmeter vs Locust vs Gatling (Compare table)
Jmeter vs Locust vs Gatling (in Action)
GITHUB Repository:
Resources:
https://www.oracle.com/java/technologies/downloads/
https://jmeter-plugins.org/install/Install/
https://github.com/haint/jmeter-sample
http://docs.locust.io/en/stable/installation.html
https://github.com/locustio/locust
https://gatling.io/open-source/
https://www.jetbrains.com/idea/download/
https://code.visualstudio.com/download
https://plugins.jenkins.io/performance/
https://plugins.jenkins.io/gatling/
Example App:
Youtube Webinar Video: