0
votes

I am going to test database read performance with Jmeter Java Sampler. Basically, query database 10000 times with primary key as query condition like ID with Thread group and Java Sampler.

I need to load 10000 records into database before executing the Thread Group. The 10000 records will be looped for the 10000 times database read.

I have looked into the preprocessor of Jmeter. I can insert 10000 records into database in preprocessor, but I do not know how to pass the 10000 IDs to Thread Group or Java Sampler. It is too long to contact IDs as a String parameter.

How I can archive the purpose? Any comment is welcome.

1

1 Answers

0
votes
  1. Instead of inserting the data using PreProcessor I would rather recommend preparing the test data in setUp Thread Group. You can write the generated IDs into a file using i.e. Flexible File Writer and then read them back with the CSV Data Set Config
  2. If the database you're testing supports JDBC protocol it makes more sense to use JDBC Request sampler because JDBC Connection Configuration allows using connection pool pattern which most probably your application will be using when talking to the database, the main idea is to set up JMeter to produce the same footprint as the application which will be accessing the database.