Creating new load testing scenarios in simulations.

Scenarios are the methods which enclose the load testing implementation. A simulation might contain multiple scenarios which are run sequentially. The scenario methods are to be annotated with @Scenario annotation in simulations which takes a name attribute. The name will be used in measurements and reporting, respectively, thus it is mandatory.

  @Scenario(name = "Health")
  public void performHealth(Measurement measurement) {

    var response = client
            .header(X_REQUEST_ID, "Rhino-" + uuid)

    measurement.measure("Health API Call", String.valueOf(response.getStatus()));

In the example above, the scenario method will make a HTTP GET request on target with the request header defined. You can use arbitrary implementation in scenario methods.

The scenario methods takes Measurement and/or UserSession instances as argument. Measurement object can be used to measure the execution time in scenarios. You can call measure on Measurement multiple times to record multiple measurements. Please refer (here)[] for more information on measurements. UserSession is a contextual object which contains information about the primary user. You can use user session to store data which will be valid during the session. Please refer here for more information on user sessions.

The scenarios will be executed by threads leased from the threadpool underlying the framework of which number can be configured in configuration file. Please refer to Parallelization section.