I try to make an injection with a variety of "breaks" and "atOnceUsers". I didn't found a nice solution on the documentation for that.
My approach was to create a function called "getNextNumber()" with a local counter, to increase the number of "atOnceUsers", but the function was only called once at the beginning.
Any ideas?
My code:
class TestCombinationGetFiles extends Simulation {
var counter: Int =1
def getNextNumber():Int = {
counter+= 1
return counter
}
val Get20Files = scenario("get20Files")
.feed(UuidFeeder.feeder)
.exec(WebAuth.AuthenticateUser)
.pause(30)
.exec(WebCloudContent.GoToTestFolder20)
val Get10Files = scenario("get10Files").feed(UuidFeeder.feeder)
.exec(WebAuth.AuthenticateUser)
.pause(15)
.exec(WebCloudContent.GoToTestFolder10)
val loadFolder20TestRamp =
scenario("loadFolder20TestRamp").exec(WebAuthSwisscom.AuthenticateUser,
WebCloudContentSwisscom.GoToTestFolder20)
setUp(Get20Files.inject(
splitUsers(36) into(
atOnceUsers(getNextNumber()))
separatedBy(30 seconds))
/* messy Code with correct functionality
atOnceUsers(1),
nothingFor(30 seconds),
atOnceUsers(2),
nothingFor(30 seconds),
atOnceUsers(3),
nothingFor(30 seconds),
atOnceUsers(4),
nothingFor(30 seconds),
atOnceUsers(5),
nothingFor(30 seconds),
atOnceUsers(6),
nothingFor(30 seconds),
atOnceUsers(7),
nothingFor(30 seconds),
atOnceUsers(8),
nothingFor(30 seconds))
*/
,
Get10Files.inject(
splitUsers(16) into(
atOnceUsers(1))
separatedBy(15 seconds))
).protocols(WebSetUp.httpProtocol)
}