class EFT extends BaseScenario {
def r = new scala.util.Random
override def scenarioBuilder = scenario(getClass.getSimpleName)
.exec(Account.create)
.exec(Account.login)
.exec(Account.activate)
.exec(Loop.create)
.forever(getAction) // <--- the step is only calculated once during compilation
var getAction: ChainBuilder = {
var c = r.nextDouble() * 100
def getChance(percent: Double): Double = {
c = c - percent
c
}
if (getChance(27.7) < 0) { Log.putEvents }
else if (getChance(18.3) < 0) { Log.putBinary }
else if (getChance(17.2) < 0) { Loop.list }
else if (getChance(14.7) < 0) { Key.listIncomingRequests }
else { Account.get }
}