Inject as many users as contained in feeder

Hi,

I use a CSV-based feeder to parametrize the users injected (user ids, passwords, etc.). However, I have the constraint that I shall instantiate every user only once. This means that I have to inject as many users as there are valid records in the CSV-file (i.e., the feeder is exhausted). Of course I can hardcode the number but I do not want to have this dependency between the feeding file and the actual simulation implementation.

Is there any solution for that?

Thanks,
Ingo

If you use a CSV feeder (it also works for the JDBC feeder), you can get the size of your feeder :

val myFeeder = csv("foo") val recordsCount = myFeeder.records.size

And then use recordsCount in your injection profile :slight_smile:

Cheers,

Pierre

Thanks a lot. Work’s like a charm. I wasn’t aware that the file is read at once so that I can access the number of lines when starting the simulation

Ingo

Whenever possible, Gatilng reads data for your feeders at once, so that I/O operations needed to get your data don’t slow down your simulation.

Cheers,

Pierre