Gatling DataWriters as JVM Property
Gatling is an open-source load and performance testing tool written in Scala. By default Gatling supports the following storage backends: console, file, graphite, jdbc. To configure the utilized backend you need to modfiy the gatling.conf.
writers = [console, file] # List of DataWriters to which Gatling write simulation
The Gatling documentation  offers two possibilities to override configuration values:
- Change the value in
- Set a System property (the name of the property must match HOCON Path )
Since option 1. is not an option – let’s go with system properties. But wait, what the hell is HOCON Path and how do I define a list property in HOCON Path?
HOCON stands for “Human-Optimized Config Object Notation” and its primary goal is: keep the semantics (tree structure; set of types; encoding/escaping) from JSON, but make it more convenient as a human-editable config file format.
As shown in
gatling.conf the datawriter property resolves to: gatling.data.writers.
If you read through the HOCON docs carefully you can see the following statement:
This allows creating an array in a properties file like this:
12 foo.0 = "a"foo.1 = "b"
// In one line
$ JAVA_OPTS="-Dgatling.data.writers.0=file -Dgatling.data.writers.1=console" ./bin/gatling.sh
// In two lines
$ export JAVA_OPTS="-Dgatling.data.writers.0=file -Dgatling.data.writers.1=console"