Gatling Installation & Configuration

In this tutorial, We will learn the installation & configuration of the Gatling Testing Tool.

Here is the table of contents!

  • Installation of Gatling
  • File Structure 
  • Details of Simulations
  • Configurations
  • Advantages
  • Results & Reports

Prerequisites

  • Ubuntu
  • Java JDK

gatling

Installation of Gatling

First of all, we need to install Gatling from the command line or from this link.

From the command line: apt-get install Gatling

gatling

After running the ./gatling.sh command, you will see simulation number prompt text to select simulation number from the shown list, and you can give a short description for this run.

File Structure of Gatling Performance Project

gatling

  • /results: contains the benchmark results in web format
  • /bin: contains the scripts for launching Gatling
  • /target: contains the files resulting from the compilation of our scenarios + cache
  • /conf: contains configuration files (log level -will be explained)
  • /user-files: contains the .scala scenario definition files
  • /lib: gatling jar

You can add your own simulations to the folder /user-files/simulations

gatling

Simulations of Gatling

A Simulation is a real Scala class containing 4 different parts:

  • The HTTP protocol configuration
  • The headers definition
  • The scenario definition
  • The simulation definition

Gatling Configurations

To configure Gatling you edit the configuration file – # This file contains all the settings configurable for Gatling with their default values.

  • Directory show default locations:

gatling

  • For report customization, depends on projects needs, default values & explanations below:

gatling

  • Monitoring configuration:

graphite

To configure Gatling logging you can edit the logback.xml configuration file.

Gatling Advantages

  • Open Source.
  • Efficient to run the PT tests.
  • Scripts are written with Scala code.
  • Defines a DSL designed for expressing load tests, easy to learn scripts just reading.
  • It generates meaningful charts.
  • Graphite & Jenkins Integration.
  • Supports input files CSV, TSV, SSV to access random data for Data-Driven tests.

Recording Scenarios

For recording, browser proxy: 127.0.0.1  and port: 8888

gatling_proxy

now just run ./recorder.sh under bin directory.

gatling-recorder

below screen shows up, we will use to create scenarios just click on the start button.

gatling_recorder2

We can include or exclude requests ( e.g. images, CSS, JS, etc. ) using whitelist & blacklist options, For example, if you don’t want to record any CSS files you can use some regex.

blacklist

We are ready to record the scenario.

gatling_record_3

go to address:  www.teknosa.com 

gatling_recorder4

Results & Reports

After running your scenario, you can find the results under your /results folder as the index.html file. The below chart shows how response times are distributed among standard ranges (can be configured )

Report_1

Executions Success and Failures can go into detail on every request.

report_2

Thanks,
Onur Yazir

2 thoughts on “Gatling Installation & Configuration”

  1. How to filter the time in seconds? If I want to use other load generator how it possible to do that?
    Thanks in advance.

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.