Gatling Introduction For Java Section-C
Gatling Introduction For Java Section-C
Introduction for
Java Users
Section C Overview 3
The documentation on simulation design also has details of the differences between the
models and describes the DSL methods that Gatling provides for simulation design:
https://gatling.io/docs/gatling/reference/current/core/injection/#open-vs-closed-workload-mod
els
Closed Workload
Open Workload
This is an example of a simulation with 5 admin users that start at once, along with a number
of regular users that ramp at different intervals:
{
setUp(
admins.injectOpen(atOnceUsers(1)),
users.injectOpen(
nothingFor(5),
atOnceUsers(1),
rampUsers(5).during(10),
constantUsersPerSec(2).during(20)
))
.protocols(httpProtocol);
}
Good practice in designing your load simulation is to check this Active Users along the
Simulation graph in your Gatling test reports, and then adjust your load injection simulation
as required.
Standalone Mode
Executing Gatling in standalone mode means simply executing the gatling.sh or gatling.bat
file within the /bin folder of the Gatling download that you extracted on your machine.
Remember that your Gatling simulation scripts should be within the user-files/simulations
folder of that same repository, and any support files such as CSV data files should be in the
user-files/resources/data folder.
Maven
Refer to the Maven Plugin documentation for full instructions on using Gatling with Maven -
https://gatling.io/docs/gatling/reference/current/extensions/maven_plugin/
Gradle
$ gradle gatlingRun-com.project.simu.MySimulation
Refer to the Gradle plugin documentation for full instructions on using Gatling with Gradle -
https://gatling.io/docs/gatling/reference/current/extensions/gradle_plugin/
Gatling produces a detailed graphical test report at the end of each test execution. The
report will look something like this: