如何覆盖gatling.conf以进行石墨配置?

时间:2015-04-16 13:46:08

标签: maven graphite gatling

我下载了gatling作为maven依赖项,现在我正在寻找如何覆盖gatling.conf文件来配置gatling和graphite之间的连接。

所以我创建了一个像这样的gatling.conf文件:

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
  }
}

在我的src / main / resources / conf / gatling.conf

这是我的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>

我做错了,还有另一种方法可以使用配置文件吗?或者我将不得不用jvm args覆盖所有选项?

干杯。

1 个答案:

答案 0 :(得分:2)

你错过了配置root,gatling。因此,您的值不会覆盖任何内容。将data { … }块包裹在gatling { … }块中,然后就可以了。