How to store data from a loop execution

Hi,

Here is my simplified use case, wondering if anyone has a suggestion for me.

Here is my objective:

  1. Admin logs in and creates ‘n’ number of users in a loop(sequentially). A simple http POST request in a loop.
  2. Each successful call, returns a unique activation token that the user will require to setup his/her account.
  3. I want the list of tokens after the loop executed(step 1).
  4. I want to have ‘n’ user setup their account using those tokens in the next step simultaneously.

Any suggestions?

Is this use case or for test data generation ?

What is token expiry time ?

If it’s for test data generation and token expiry time less let’s have admin registration + user account setup in one flow.

However, that is avoiding the real world use case. I am hopeful that there may be a better way in Gatling to handle that rather than changing my use case.

I can think of storing those activation tokens in a mutable data structure in the session object and using it later. But wondering if anyone else has any suggestion for me or thought about it.

Why not use Redis as an intermediate data store?

That’s an interesting thought, Barry. Can you please post a sample snippet or link to follow up?

Hi,

Redis client info available here:

https://github.com/debasishg/scala-redis

Take a look at Gatling’s Redis Feeder (only used for reading from Redis - but you can get the idea of how the client works - it’s pretty simple to implement both read and write yourself):

http://gatling.io/docs/current/session/feeder/

https://github.com/gatling/gatling/blob/master/gatling-redis/src/main/scala/io/gatling/redis/feeder/RedisFeeder.scala

Hope this helps,

Barry