.java
Simple JMeter performance tests Java API
💙 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.
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 project as a starting point.