How to override config settings with system variables

When i read the comment here about adding properties with -D i tried to do the following:

java -Dgatling.graphite.rootPathPrefix=cnl1499.mysql -s MYSimulation -df ./bin

But these -D values are not taken in account.
When diving into the source of GatlingConfiguration.scala i saw that it did not take the system properties in account.
After the following change it worked like expected :

old new
… … @@ -38,8 +38,9 @@ object GatlingConfiguration extends Logging {
38 38 val defaultsConfig = ConfigFactory.parseResources(classLoader, “gatling-defaults.conf”)
39 39 val customConfig = ConfigFactory.parseResources(classLoader, “gatling.conf”)
40 40 val propertiesConfig = ConfigFactory.parseMap(props)
41 + val systemConfig = ConfigFactory.systemProperties()
41 42
42 - val config = propertiesConfig.withFallback(customConfig).withFallback(defaultsConfig)
43 + val config = systemConfig.withFallback(propertiesConfig).withFallback(customConfig).withFallback(defaultsConfig)
43 44
44 45 configuration = GatlingConfiguration(
45 46 simulation = SimulationConfiguration(

Is this needed → can you get this in?
Or did i do something wrong in the first place?

You’re completely right, I messed up.

Thanks for reporting,


Hi Stephane,

Using Gatling-2.1.4 I'm trying to override the gatling.graphite.rootPathPrefix value by passing a value through the gatling-maven-plugin jvmArgs. This doesn't seem to work, is this not possible or am I doing something wrong here?




Hi Daniel,

Your syntax is invalid, remove -D

The configuration path for rootPathPrefix is gatling**.data**.graphite.rootPathPrefix.
The path you’re using is incorrect, which explains why it doesn’t work.

Note: you could also configure it directly from gatling.conf :




<jvmArg>${env.COMPUTERNAME}</jvmArg> works fine for me.