Forum Discussion

Ashley's avatar
Ashley
Occasional Contributor
15 years ago

How do I dynamically distribute data across threads?

I’m writing a load test for an SMS gateway, the SMS’s are triggered through a http request that passes username, password, cellNumber and message as parameters. It’s a very simple system.

The object of the load test is to see whether or not the sms gateway can cope with a very large volume (1000 sms messages from unique users a minute etc). The same user can’t send multiple messages as they’re handled differently.

The username, password and phone number need to be pre-registed with the system. This is achieved for testing purposes by simply loading the details into the systems database before hand, no problem.

I have a csv file as follows:

Username1, Password1, cellNumber1
Username2, Password2, cellNumber2
...
Username999, Password999, cellNumber999
Username1000, Password999, cellNumber1000

I can load them into a testcase then iterate down the list of users perfectly fine but how do I distribute them across threads in a loadui test?

i.e. If im running 8 threads:

I’d like the 1st user to be done by the first thread then when it’s done the 9th user to be done by the first thread.
Similarly for the second thread the first user should be the 2nd user in the csv and then the second user should be the 10th user etc.

e.g.

T U1 U2 U3 U4  ...
1 1 9 17 25
2 2 10 18 26
3 3 11 19 27
4 4 12 20 28
5 5 13 21 29
6 6 14 22 30
7 7 15 23 31
8 8 16 24 32


Is there a way of doing this using groovy some how?
  • Hi!

    hmm... loadUI doesn't really use a "thread-based" approach to generating load, what is the reason you want to use this approach? Is it to make sure you have X number of simultaneous users (ie threads) at any given time?

    regards!

    /Ole
    eviware.com
  • Ashley's avatar
    Ashley
    Occasional Contributor
    Sorry for the slow reply, holiday

    Yes, the reason is that we want to ramp up to 1000 unique simultanious users at the same time, due to sessions etc we cant have the same user logged in multiple times.
  • Hi,

    It sounds like you sould use the Fixed Load Generator. For it to work you will have to connect the second output terminal from the Runner component into the second input terminal of the Fixed Load Component. Then set the Load setting to the number of parallel requests you want (corresponds to the number of Threads) and set the interval setting to 0.

    Regards,
    Dain
    eviware.com