Git Product home page Git Product logo

gatling's Introduction

Gatling Performance and Load Testing

Gatling is designed to treat your performance tests as production code. Maintenance and automation are made easier.

Before running tests, it would be wise to ensure your network/server host is aware and OK to support the testing as these can draw a lot of resources and bandwidth. - you don't want to perform any unintended DoS!

##Dependencies

Quick start

From the IDE terminal or command line, ensure you are at the root dir of the project

Run all simulations

mvn clean gatling:test

Run specific simulation

mvn clean gatling:test -Dgatling.simulationClass=simulations.SampleSimulation1

View results

  • Results are packaged as Highcharts reports: target/gatling/{simulation}/index.html
  • Note that by using the mvn 'clean' command, existing reports will be removed before each run

##Configuration

###Gatling-Maven-Plugin Gatling is run through a maven plugin as detailed in pom.xml.

###Gatling The Gatling plugin has a most configurations setup however you can override these in /resources/gatling.conf

   directory {
      data = ./data                       # Folder where user's data (e.g. files used by Feeders) is located
      bodies = ./bodies                   # Folder where bodies are located
      simulations = ../scala/simulations  # Folder where the bundle's simulations are located
      #reportsOnly = ""                   # If set, name of report folder to look for in order to generate its report
      #binaries = ""                      # If set, name of the folder where compiles classes are located
      #results = results                  # Name of the folder where all reports folder are located
    }

Of particular note is the results folder if you want to maintain results outside of the default target directory

###Gatling recorder Recorder config is detailed in /resources/recorder.conf however many of these can also be set from the recorder GUI

Creating new simulations

A quick way to generate new simulations is to use the bundled recorder /recorder/Recorder

  • From within your IDE, Run the Recorder scala object, this will launch the GUI
  • By default, this will output the recording as 'RecordedSimulation.scala' in the simulations folder
  • See the Gatling help docs for setting up your browser and using the recorder
  • Once you have a recording you'll want to separate out your scenario and simulation

Performance profiles

Gatling has a number of options for testing the desired performance requirements.

setUp(
  scn.inject(
    nothingFor(4 seconds),
    atOnceUsers(10),
    rampUsers(10) over (5 seconds)
    constantUsersPerSec(20) during (15 seconds),
    constantUsersPerSec(20) during (15 seconds) randomized,
    rampUsersPerSec(10) to 20 during (10 minutes),
    rampUsersPerSec(10) to 20 during (10 minutes) randomized,
    splitUsers(1000) into (rampUsers(10) over (10 seconds)) separatedBy (10 seconds), 
    splitUsers(1000) into (rampUsers(10) over (10 seconds)) separatedBy atOnceUsers(30),
    heavisideUsers(1000) over (20 seconds) 
  ).protocols(httpConf)
)

gatling's People

Stargazers

Maximilian Chaplin 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.