blank
blank

Reputation: 18170

How to set up a large amount of request data for a jMeter load test

I want to simulate a few hundred http request each with a different token and userId which I have in a database table.

What's the best way of setting up a jMeter load test to do this?

Upvotes: 3

Views: 3088

Answers (2)

justMe
justMe

Reputation: 2408

One way is to put all your parameters into a csv file and use CSV Data Set Config in jmeter. Right click on the thread you have created - add- Config Element- CSV Data Set Config. Remember you need to set the Number of Threads(users) to match the number of users in your CSV file.

Upvotes: 0

UBIK LOAD PACK
UBIK LOAD PACK

Reputation: 34516

You can use JDBC Sampler to extract you data from DB to create a CSV and a JSR223 Sampler using groovy (add groovy-all.jar in jmeter/lib folder) to write the extracted values to a CSV file.

Then in the real plan , use CSV DataSet Config using the generated file.

Depending on how you want to use the dataset, you will play with Sharing mode attribute.

If you want to do both steps within the same plan you can use a Setup thread Group that will contain the JDBC Sampler part to write the CSV File, this will use 1 thread and then the other part in regular Thread Group that will use the number of users you need.

Upvotes: 4

Related Questions