Add following to build.gradle
plugins {
id "com.github.lkishalmi.gatling" version "0.3.0"
}
- 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.
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.
Directory | Meaning |
---|---|
|
Simulation sources |
|
Feeder data |
|
Request bodies |
|
Custom gatling configurations |
Task name | Description |
---|---|
|
Compiles |
|
Executes all |
|
Executes single |
- Examples
-
-
Run all simulations
$ gradle gatling
-
Run single simulation implemented in
com.project.simu.MySimulation
class$ gradle gatling-com.project.simu.MySimulation
-
The plugin defines the following extension properties in the gatling
closure
Property name | Type | Default value | Description |
---|---|---|---|
toolVersion |
String |
'2.2.0' |
|
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 |
simulations |
Closure |
{ include "**/*Simulation.scala" } |
Simulations filter. See Gradle docs |
- Example
-
gatling { toolVersion = '2.2.0' jvmArgs = [ '-server', '-Xms512M', '-Xmx512M' ] simulations = { include "**/folder1/*Simu.scala" <1> include "**/folder2/*Simulation.scala" <2> } }
-
all
Scala
files fromfolder1
ending withSimu
. -
all
Scala
files fromfolder2
ending withSimulation
.
-
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.
- Example
-
dependencies { gatlingCompile 'org.apache.commons:commons-lang3:3.4' (1) gatlingRuntime 'cglib:cglib-nodep:3.2.0' (2) }
-
adding
commons-lang3
to compile classpath forGatling
simulations. -
adding
cglib
to runtime classpath forGatling
simulations.
-