Skip to content

loadtest4j/loadtest4j-reporter-slf4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loadtest4j-slf4j

Build Status Codecov Maven Central

SLF4J reporter for loadtest4j.

Setup

Add this library to your project's pom.xml:

<dependency>
    <groupId>org.loadtest4j.reporters</groupId>
    <artifactId>loadtest4j-slf4j</artifactId>
    <scope>test</scope>
</dependency>

Note: Reporters reference the core loadtest4j library in provided scope. All standard Drivers will provide it automatically. If you are not using a standard Driver, you must add org.loadtest4j:loadtest4j to your pom.xml.

Note: SLF4J requires an appender to work. Your Driver or Web framework (such as Dropwizard) may provide one automatically. If not, you must add an appender (such as Logback) to your pom.xml.

<dependencies>
    <dependency>
        <groupId>org.loadtest4j.drivers</groupId>
        <artifactId>loadtest4j-[driver]</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.loadtest4j.reporters</groupId>
        <artifactId>loadtest4j-slf4j</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

Usage

Attach the reporter using the LoadTesterDecorator, or any other method that suits you.

public class PetStoreLT {
    private static final LoadTester loadTester = new LoadTesterDecorator()
            .add(new Slf4jReporter())
            .decorate(LoadTesterFactory.getLoadTester());
    
    @Test
    public void shouldFindPets() {
        // ...
    }
}