I am trying to compare the performance difference between DELETE batch sizes using JMeter.
I have a table which I populate with a large amount of test data. Next, I have a JDBC Request that runs the following statement:
delete from tbl where (entry_dt < '2019-02-01') and (rownum <= 10000);
I want to keep running this until the table is empty, and record the time taken to clear the table.
I will run this thread multiple times to get an average execution time, and repeat this process for different batch sizes.
How should I define my While Controller to achieve this?
I read from other sites that I can use a Transaction Controller to time my process, but I am not familiar with this feature. How should I define my Transaction Controller to achieve this?
解决方案
Add Transaction Controller to be a top level test element under the Thread Group
Add While Controller as a child of the Transaction Controller and use the following condition expression:
${__jexl3(${count_1} > 0,)}
Put your JDBC Request sampler as a child of the While Controller
Add JDBC PostProcessor as a child of the JDBC Request sampler and configure it like:
That's it, While Controller will iterate until there are entries in the tbl table and the Transaction Controller will record the cumulative time of all JDBC Request samplers executed.