Gatling is a very powerful load & performamce testing tool for analyzing and measuring the performance of a variety of services, mainly focuses on Web Applications. This testing framework is build in Scala, Akka & Netty. It is an open source framework & its code is available at github.
Gatling comes up with a Recorder which records the scenarios & responsible for converting those scenarios into Gatling Simulations. It generates graphical reports after successful execution of the Gatling Simluation in html format to analyse the test report.
This tool is basically known as the developers testing tool as it allows to fully automate the performance testing scenarios(Continuous Integration). Galting can be easily integrate with the other developers tools i.e Maven, SBT, Jenkins, TeamCity etc.
Gatling can be downloaded from the link– https://gatling.io/open-source or also can be installed from terminal by using the command–
$ sudo apt-get install gatling
Note: Before Gatling installation, there must be java installed in the system. To check the java version through the command prompt, run the command i.e java -version
Gatling Bundle Structure:
After unzip the downloaded folder, you can find the below listed folders & sub-folders:
you can also get the bundle structure on terminal by navigation to the Gatling folder & type the command as– tree (“tree folder_name” for the tree structure for a particulate directory)
Note: To list the directory structure via tree command on terminal you need to install the tree package:
$ sudo apt-get install tree
It contains the launch script for the Gatling (gatling.bat/gatling.sh) & the Gatling Recorder(recorder.bat/recorder.sh).
gatling.bat/gatling.sh script files are basically used to run the Gatling Scripts or recorded scenarios & generates the results in the .html format.
recorder.bat/recorder.sh script files are used to record the scenarios over browser which is later used as input to Gatling to generate the load testing reports.
For Windows, use the *.bat scripts i.e gatling.bat or recorder.bat
To execute the script navigate to the bin folder at terminal & run:
$ ./gatling.bat //for Gatling
$ ./recorder.bat //for Recorder
For Ubuntu, use the *.sh scripts i.e gatling.sh or recorder.sh
To execute the script navigate to the bin folder at terminal as given follows & run commands:
- $ ./gatling.sh
2. $ ./recorder.sh
It contains configuration file for Gatling i.e Akka, Logback.
This folder contains all the library(jar) files i.e binaries used by Gatling.
This folder contains the project wise reports for the Gatling Simulation in the .html format & log file i.e simulation.log. It generates various types of reports i.e active users along the simulation, response time distribution, response time percentiles over time(OK), number of requests per second & number of responses per second.
Gatling Reports are well described in the graphical & table format as shown below.
Target folder contains the project wise .class files which are generated after the Gatling Simulation scripts execution.
Users files contains the two sub-directories i.e Resources & Simulations.
Resources folder contains the data feeder files (csv format) & templates for request bodies.
Simulation folder contains all the project wise simulation scala files which are recorded through the Gatling Recorder.
This is all about the Gatling bundle structure. In case you have any queries then feel free to ask in the comment section below.