Code Monkey home page Code Monkey logo

gatling_perf's Introduction

GATLING:

Powerful open-source Performance Test tool released in December, 2011. Gatling is a lightweight DSL written in Scala that comes with the interesting premise of "treating your performance tests as production code".

Steps for setting up Mac

  1. Install Homebrew

Run this command on the terminal: /usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

  1. Install Java and

Now that you have homebrew,you can get JDK using Homebrew cask. $ brew cask install java

  1. Install gradle

We have installed using homebrew $ brew install gradle

  1. Install the IDE (optional)

  2. We have used community edition of Intellij from https://www.jetbrains.com/idea/

Add Scala plugin to IDE On Startup IntelliJ gives an option to add Scala plugin. You can check it and install on launching IntelliJ for the first time. Otherwise, as soon as you add “apply plugin: “scala” in your build.gradle, IntelliJ prompts you to download scala plugin.

Steps for setting up Windows

  1. Install Java(JRE & JDK)

  2. Install gradle

  3. Install the IDE(or any other IDE – optional) We have used community edition of Intellij from https://www.jetbrains.com/idea/

  4. Add Scala plugin to IDE On Startup IntelliJ gives an option to add Scala plugin. You can check it and install on launching IntelliJ for the first time. Otherwise, as soon as you add “apply plugin: “scala” in your build.gradle, IntelliJ prompts you to download scala plugin.

GATLING RECORDER:

Step 1 : Configure Browser Change the proxy settings, give address as 'localhost' and port as say - 8080

Step 2 : Recording the Scenario For mac: naviagte to the bin folder of Gatling in terminal and run $sh recorder.sh

For Windows: Go to the bin folder of Gatling bundle and open the "recorder.bat" file

  • Enter the port number in localhost box - 8080

  • Enter the package and class name

  • Check “Follow Redirects”, “Infer HTML resources”, “Remove Cache Headers” and “Automatic Referrers” options

  • Click on Start button

  • Record the scenario you want to test

  • Close the browser

  • Click on “Stop & save” button and Gatling recorder window is closed

Note: for more info on the options on recorder, please refer http://gatling.io/docs/current/http/recorder/

Step 3 : Executing load testing using Gatling For mac: naviagte to the bin folder of Gatling in terminal and run $sh gatling.sh

For Windows: Go to the bin folder of Gatling bundle and open the "gatling.bat" file

  • Select the file to be executed, enter the simulation number and enter the simulation description (optional)

Step 4 : Viewing results Results would be generated in HMRL format on running the simulation file as mentioned in Step 3. Open the html file in any browser to view the same.

Note: For more on understanding the results, refer : http://gatling.io/docs/current/general/reports/

Gatling structure can be defined in 4 different parts:

  1. HTTP protocol configuration – This will define your base URL that you will be running your tests against. Also, you can define some other configurations such as user agent, language header, connection and so on.
  2. Headers definition – This provides the headers for each request that will be sent to the server. This is relevant because the headers also add a bit of load to the server you are testing.
  3. Scenario definition - The core of your test! A Scenario is a group of actions (GET, POST, etc.) that will be executed in order to simulate a user interaction with your application.
  4. Simulation definition - This defines the load (amount of users) that will concurrently execute your scenario for a period of time.

Running the simulation scripts in terminal (For Mac):

Use the following command (Here 'simulation1' is the name of the task mentioned in build.gradle file):

./gradlew simulation1

gatling_perf's People

Contributors

psudha3 avatar vijayaragavang 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.