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.
1 2 3 4 5 6 7 |
gatling { ... data { writers = [console, file] # List of DataWriters to which Gatling write simulation } ... } |
The Gatling documentation [1] offers two possibilities to override configuration values:
- Change the value in
gatling.conf
. - Set a System property (the name of the property must match HOCON Path [2])
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.
Solution
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"
1 2 3 4 5 6 |
// 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" $ ./bin/gatling.sh |
Sources
[1] https://gatling.io/docs/2.3/
[2] https://github.com/lightbend/config/blob/master/HOCON.md#hocon-human-optimized-config-object-notation
[3] https://github.com/gatling/gatling/issues/3055
Recent posts






Comment article