Home

Awesome

Gatling remote sbt plugin

Goal

Gatling is excellent load test framework, but is has some limitations. The biggest limitation is absence of remote execution. This plugin brings ability to run simulation remotely through ssh.

Dependencies

Installation

We mimic gatling-sbt versioning. For our purposes we use fourth digit in version number.

plugins.sbt

addSbtPlugin("ru.pravo" %% "gatling-remote-sbt" % "3.0.0.1")
addSbtPlugin("com.typesafe.sbt" %% "sbt-native-packager" % "1.3.6")
addSbtPlugin("io.gatling" %% "gatling-sbt" % "3.0.0")

build.sbt

enablePlugins(GatlingPlugin, JavaAppPackaging, GatlingRemotePlugin)

gatling-remote.conf

hosts = [
  {
    host = "localhost",
    login = "root",
    password = "root",
    port = 2222
  }
]

Configuration

There are multiple setting for configuration:

SettingDescriptionDefault
gatlingConfigFilePathPath to gatling.conf filesrc/test/resources/gatling.conf
gatlingAkkaConfigFilePathPath to gatling-akka.conf filesrc/test/resources/gatling-akka.conf
gatlingRemoteConfigFilePathPath to gatling-remote.conf filesrc/test/resources/gatling-remote.conf
logbackConfigFilePathPath to logback.xml filesrc/test/resources/logback.xml
remoteWorkDirectoryPathPath to work directory on remote server/tmp
deployTimeoutDurationTimeout for deploying operationInfinite
runTimeoutDurationTimeout for running operationInfinite
grafiteRootPathPrefixRoot path that will be overwritten in run.shgatling
configurationFilesConfiguration files that will be deployed into /conf directorySeq(gatling.conf, gatling-akka.conf, gatling-remote.conf, logback.xml)
userFilesDataFilesUser files that will be deployed into /user-files/body directorySeq()

You can override any of these settings. For example

gatlingConfigFilePath in Gatling := (resourceDirectory in Compile).value / "gatling.conf"

will force plugin to take gatling.conf from /src/resources/gatling.conf

Using

Run simulation

sbt gatling:testOnlyRemote basic.BasicExampleSimulationFails

Get assembled project

sbt gatling:assembleProject