One of my customers uses Gatling to continuously run load tests for a web portal. I faced the challenge that test results should dynamically be written to various backends. Since changing the gatling.conf before each test was not an option I was wondering how to pass a list of datawriters to Gatling as JVM argument.
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 towhich Gatling write simulation
The Gatling documentation  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 )
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:
Long story short, to invoke Gatling and pass a list of datawriters looks as follows: