Parallel execution of multiple scenarios

Hans Holzbart picture Hans Holzbart · Dec 5, 2016 · Viewed 17.8k times · Source

What ist the best practice for parallel execution of multiple scenarios? For example 30% Users execute scenario1 and 70% users scenario2.

Is the code below the right way or is it better to have one scenario with contional executions of REST calls?

class MySimulation extends Simulation {

  val userIdsData = csv(userIdsCSV).queue



  ...



  val scenario1 = scenario("Scenario 1")

    .feed(userIdsData)

    .get(...)



  val scenario2 = scenario("Scenario 2")

    .feed(userIdsData)

    .get(...)

    .post(...)



  setUp(scenario1.inject(rampUsers(30) over (ramp seconds))

      .protocols(HttpConfig.value(baseURL)),

    scenario2.inject(rampUsers(70) over (ramp seconds))

      .protocols(HttpConfig.value(baseURL))

  )

}

Answer

Pritam Banerjee picture Pritam Banerjee · Dec 5, 2016

Whatever you are doing is absolutely fine.

The way you are running the setup you will see that the requests are running in parallel.