如何为石墨配置覆盖 gatling.conf?

How to override gatling.conf for graphite configuration?

我下载了 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 覆盖所有选项?

干杯。

你缺少配置根,gatling。因此,您的价值观无视任何事物。将您的 data { … } 块包裹在 gatling { … } 块中,它会起作用。