[Gatling] Know about stress test tool

Gatling is kind of stress test tool to test your app’s performance, for detail infos, please refer to official document.

Next I will summurize how to install gatling on your Macbook.

1.Download gatling

wget https://repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/2.3.1/gatling-charts-highcharts-bundle-2.3.1-bundle.zip

2.Unzip & Enter

unzip gatling-charts-highcharts-bundle-2.3.1-bundle.zip & cd gatling-charts-highcharts-bundle-2.3.1-bundle

3.Start record function

bin/record.sh

After starting record script, you could see the UI as below:

Please configure the proxy port and click Start button. Then you could set your browser proxy and surf the target URL, gatling will capture the content as below:

If you finished and wanna save the result, please click Stop & Save button, gatling will generate a new scala script which save all your behaviors just now, and the script will be under user-files/simulations/

xxx@xxx 2.3.1 $ ll user-files/simulations/
total 328
drwxr-xr-x@ 4 1154257814  80     136 Aug 13 11:30 .
drwxr-xr-x@ 5 1154257814  80     170 Mar  6 22:59 ..
-rw-r--r--  1 1154257814  80  166657 Aug 13 11:54 RecordedSimulation.scala
drwxr-xr-x@ 4 1154257814  80     136 Mar  6 22:59 computerdatabase

If you wanna change the generated file location, please modify outputFolder in conf/recorder.conf

hongmeng.wang@X0621 2.3.1 $ cat conf/recorder.conf 
recorder {
    core {
        className=RecordedSimulation
        encoding=utf-8
        harFilePath=""
        headless=false
        mode=Proxy
        outputFolder="/usr/local/Cellar/gatling/2.3.1/user-files/simulations"
        package=""
        ...
        ...