github abstracta/jmeter-java-dsl v0.12
0.12

latest releases: v1.27, v1.26, v1.25.3...
3 years ago

Now is possible to specify a ramp-up period when creating threads in thread group!

Warning: This method is deprecated since 0.18.

Using ramp-up period avoids thread creation interfering with test collected metrics, creating them in a progressive manner.

Here is an example:

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)
        .rampUpPeriod(Duration.ofSeconds(5))
        .children(
          httpSampler("http://my.service")
        ),
    ).run();
    assertThat(stats.overall().elapsedTimePercentile99()).isLessThan(Duration.ofSeconds(5));
  }
  
}

Don't miss a new jmeter-java-dsl release

NewReleases is sending notifications on new releases.