Skip to content

loadtest4j/loadtest4j-gatling

Repository files navigation

loadtest4j-gatling

Build Status Codecov Maven Central

A Gatling driver for loadtest4j.

Setup

  1. Add the library to your pom.xml:

    <dependency>
        <groupId>org.loadtest4j.drivers</groupId>
        <artifactId>loadtest4j-gatling</artifactId>
        <scope>test</scope>
    </dependency>
  2. Configure the driver in src/test/resources/loadtest4j.properties:

    loadtest4j.driver.duration = 10
    loadtest4j.driver.url = https://example.com
    loadtest4j.driver.usersPerSecond = 1
  3. Optional: Add advanced Gatling configuration in src/test/resources/gatling.conf.

  4. Write your load tests using the standard LoadTester API.

Control Gatling logging

To reduce Gatling log output, change the log threshold for its noisiest classes in your SLF4J logger configuration.

If you are using Logback (the default Gatling logger), you could configure logback.xml like this:

<configuration>
    <!-- Set up the root logger and appender, then include these lines -->
    <logger name="akka.event.slf4j.Slf4jLogger" level="OFF" />
    <logger name="io.netty" level="OFF" />
    <logger name="io.gatling" level="OFF" />
    <logger name="org.asynchttpclient.netty" level="OFF" />
</configuration>