mavengraphitegatling

How to override gatling.conf for graphite configuration?


I downloaded gatling as a maven dependency and now I'm looking for how to override the gatling.conf file to configure the connection between gatling and graphite.

So I created a gatling.conf file like that :

data {
  writers = [console, file, graphite] # The list of DataWriters to which Gatling write simulation data (currently supported : console, file, graphite, jdbc)
  reader = file             # The DataReader used by the charting engine for reading simulation results
  console {
    light = false           # When set to true, displays a light version without detailed request stats
  }
  file {
    bufferSize = 8192       # FileDataWriter's internal data buffer size, in bytes
  }
  leak {
    noActivityTimeout = 30  # Period, in seconds, for which Gatling may have no activity before considering a leak may be happening
  }
  graphite {
    light = false              # only send the all* stats
    host = "mygraphite.host.com" # The host where the Carbon server is located
    port = 1010                # The port to which the Carbon server listens to (2003 is default for plaintext, 2004 is default for pickle)
    protocol = "tcp"           # The protocol used to send data to Carbon (currently supported : "tcp", "udp")
    rootPathPrefix = "gatling" # The common prefix of all metrics sent to Graphite
    bufferSize = 8192          # GraphiteDataWriter's internal data buffer size, in bytes
    writeInterval = 1          # GraphiteDataWriter's write interval, in seconds
  }
}

Inside my src/main/resources/conf/gatling.conf

Here's my pom.xml :

<build>
        <plugins>
            <plugin>
                <groupId>io.gatling</groupId>
                <artifactId>gatling-maven-plugin</artifactId>
                <version>${gatling-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <configFolder>src/main/resources/conf/</configFolder>
                            <!-- Default values -->
                            <!--<configFolder>src/test/resources</configFolder-->
                            <dataFolder>src/main/resources/data</dataFolder>
                            <resultsFolder>target/gatling/results</resultsFolder>
                            <!--&lt;!&ndash;<requestBodiesFolder>src/test/resources/request-bodies</requestBodiesFolder>-->
                            <simulationsFolder>src/main/scala</simulationsFolder>
                            <simulationClass>my.awesomeCompany.scenarios.Scenarios</simulationClass>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
</build>

What I'm doing wrong, there's an other way to do that with a config file ? Or I'll have to override all the options with jvm args ?

Cheers.


Solution

  • You're missing the configuration root, gatling. Therefore, your values overrides nothing. Wrap your data { … } block in a gatling { … } block and it'll work.