Giter Site home page Giter Site logo

gradle-gatling-plugin's Introduction

Gatling Plugin for Gradle

Gatling

Master branch Build Status

Installation

Follow the steps described at Gradle Plugin Portal page.

Java 8 Upgrade
  • Due to a bug Gatling 2.2.0 is supported only from gradle-gatling-plugin version 0.3.0

  • JDK 8 is required for Gatling 2.2.0, so this plugin is also require JDK8

For whatever reason you stuck with JDK 7, please keep using the 0.2.x series of this plugin.

Project Layout

Plugin supports two source files layouts for Gatling simulations and related data.

  • Standard Gradle/Maven layout

  • Gatling-like layout

There’s no need to explicitly setup any of those. Plugin auto-detects layout during examination of project’s folder structure.

Standard Gradle/Maven layout

Directory Meaning

src/gatling/scala

Simulation sources

src/gatling/resources/data

Feeder data

src/gatling/resources/bodies

Request bodies

src/gatling/resources/conf

Custom gatling configurations

Gatling-like layout

Directory Meaning

src/gatling/simulations

Simulation sources

src/gatling/data

Feeder data

src/gatling/bodies

Request bodies

src/gatling/conf

Custom gatling configurations

Plugin configuration

The plugin defines the following extension properties in the gatling closure

Property name Type Default value Description

toolVersion

String

'2.2.2'

Gatling version

logLevel

String

'WARN'

The default Gatling console log level if no logback.xml present in the configutation folder

jvmArgs

List<String>

['-server', '-XX:+UseThreadPriorities',
'-XX:ThreadPriorityPolicy=42',
'-Xms512M', '-Xmx512M', '-Xmn100M',
'-XX:+HeapDumpOnOutOfMemoryError',
'-XX:+AggressiveOpts',
'-XX:+OptimizeStringConcat',
'-XX:+UseFastAccessorMethods',
'-XX:+UseParNewGC',
'-XX:+UseConcMarkSweepGC',
'-XX:+CMSParallelRemarkEnabled',
'-Djava.net.preferIPv4Stack=true',
'-Djava.net.preferIPv6Addresses=false']

Additional arguments passed to JVM when executing Gatling simulations

simulations

Closure or Iterable<String>

{ include "**/*Simulation.scala" }

Simulations filter.
If closure then See Gradle docs for details, otherwise an Iterable of simulations fully qualified names.

Examples

gatling {
    toolVersion = '2.2.2'
    jvmArgs = [ '-server', '-Xms512M', '-Xmx512M' ]
    simulations = {
        include "**/folder1/*Simu.scala"    <1>
        include "**/folder2/*Simulation.scala"  <2>
    }
}
  1. all Scala files from folder1 ending with Simu.

  2. all Scala files from folder2 ending with Simulation.

Tasks

Plugin provides dedicated task GatlingRunTask that is responsible for execute gatling simulations. Customer may create instances of this task to execue particular simulations. Task extends Gradle’s JavaExec task.

Default tasks

Additionally plugin creates several default tasks

Task name Type Description

gatlingClasses

-

Compiles Gatling simulation and copies resources

gatlingRun

GatlingRunTask

Executes all Gatling simulations configured by extension

gatlingRun-SimulationFQN

GatlingRunTask

Executes single Gatling simulation,
SimulationFQN should be replaced by fully qualified simulation class name.

Examples

  1. Run all simulations

    $ gradle gatlingRun
  2. Run single simulation implemented in com.project.simu.MySimulation class

    $ gradle gatlingRun-com.project.simu.MySimulation

Dependency Management

This plugin defines two configurations gatlingCompile and gatlingRuntime. By default plugins adds gatling libraries and project’s classes and tests classes to gatlingCompile configurations Additional dependencies can be added by plugin’s users.

Examples

dependencies {
    gatlingCompile 'org.apache.commons:commons-lang3:3.4' (1)
    gatlingRuntime 'cglib:cglib-nodep:3.2.0' (2)
}
  1. adding commons-lang3 to compile classpath for Gatling simulations.

  2. adding cglib to runtime classpath for Gatling simulations.

gradle-gatling-plugin's People

Contributors

atdi avatar atomfrede avatar eshepelyuk avatar lkishalmi avatar

Watchers

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