Simple JMeteropen in new window performance tests Java API

User Guide →

💙 Git, IDE & Programmers Friendly

Simple way of defining performance tests that takes advantage of IDEs autocompletion and inline documentation.

💪 JMeter ecosystem & community

Use the most popular performance tool and take advantage of the wide support of protocols and tools.

😎 Built-in features & extensibility

Built-in additional features which ease usage (like jmx2dsl and recorder) and CI/CD pipelines integration.

Example

Add dependency to your project:

<dependency>
  <groupId>us.abstracta.jmeter</groupId>
  <artifactId>jmeter-java-dsl</artifactId>
  <version>1.29.1</version>
  <scope>test</scope>
</dependency>

Create performance test:

import static org.assertj.core.api.Assertions.assertThat;
import static us.abstracta.jmeter.javadsl.JmeterDsl.*;

import java.io.IOException;
import java.time.Duration;
import org.junit.jupiter.api.Test;
import us.abstracta.jmeter.javadsl.core.TestPlanStats;

public class PerformanceTest {

  @Test
  public void testPerformance() throws IOException {
    TestPlanStats stats = testPlan(
            threadGroup(2, 10,
                    httpSampler("http://my.service")
            )
    ).run();
    assertThat(stats.overall().sampleTimePercentile99()).isLessThan(Duration.ofSeconds(5));
  }

}

You can use this projectopen in new window as a starting point.

Hear It From Our Community