I have a json file where each entry corresponds to a user id. N entries.
I wrote a scenario that perform a certain series of step for one user.
Now, I’d like to inject each user defined in the json/feeder exactly once in the scenario using rampUsers or constantUsersPerSec or similar capability.
Should I just hard code N in the rampUsers call? Is there a better way?
In code:
`
val users = jsonFile(“users.json”) // containers N user entries
val N = 1000 // hardcode N? better way?
val scn = scenario(“MyScenario”)
.feed(users) // pop a user. puts the “uid” in the session
.exec(DoSomethingForOneUser.class) // users the uid
setUp(
scn.inject(
rampUsers(N) over (1 minute) // ramp exactly N users over 1 minute
)
)
`