Simulation compared to Scenario ?

Hi,

object Scenarios {
val scn1 = …
val scn2 = …
}

I this :

import Scenarios._

class Simu1 {
setUp(scn1)
}

class Simu2 {

setUp(scn2)

}

equivalent to :

import Scenarios._

class GlobalSimu {

setUp(List(scn1, scn2))
}

Not in term of generated reports, but in term of concurrent running

Should I get the ~same results~ in the two cases ?

My Gatling version : 2.1.5

Thanks for help

No. Passing multiple scenarios to a setUp make them run concurrently. That’s used for having multiple populations of virtual users with different behaviors.

Thanks Stéphane,

I would like to call simulations from code, not from command line : something like setUpSimulation(simu1, simu2). They will run sequentially and generate different reports.
Or an equivalent with scenarios : setUpSequential(scen1, scen1) with the ability to have a report by scenario.

Is this feasible ?

Answered in another recent thread: no.

I did not find any thread about running simulations from code. There is some threads about sbt/mvn cli, not what i need. It’s not available for the moment.

Thanks

Have a look at the helper classes that are generated by the gatling-maven-archetype.

Thank you Stéphane,

That could help. The engine is based on loading compiled Simulation classes. Somehow, i must create them before, not exactly what i’m looking for. I explain :

I have a parameterized scenario : MyScenario(param1, parma2)

With a cartesian product i can do this :

listParams1 = 1::2::Nil
listParams2 = a::b::Nil

possibleScenarios = for {
p1 ← listParams1
p2 ← listParams2
} yield MyScenario(p1,p2)

I can run them concurrently in a global simulation :

GloablSimul {

setUp(possibleScenarios)
}

But if I want to run them sequentially with a report for each scenario, i have to write a simulation that wraps my scenario to do so :

Smu1forScen1 {

setUp(possibleScenarios.head)

}

Smu2forScen2 {

setUp(possibleScenarios.last)

}

I’m facing this by generating my simulation classes. But, what could be cool is something like

setUpSequentiallyWithReport(possibleScenario) = Each scenario is a simulation with its own report.

Thus, by configuration i can provide different scenarios for different environnement (local, test, integ).

Maybe it’s possible to use Gatling Engine to do this, but this is making me using an App. I would like it to continue being a test, thus i can run them from “sbt test or mvn test”.

That needs to do some POCs. But it could be a cool Gatling feature : With a cartesian product i can cover all my REST API programmatically.

I hope it’s a clean explanation of my use case.

Thanks