JMeter:如何对从数据库表中的数据删除进行批量基准测试? [英] JMeter: How to benchmark data deletion from database table in batches?

查看:880
本文介绍了JMeter:如何对从数据库表中的数据删除进行批量基准测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用JMeter比较DELETE批处理大小之间的性能差异.

I am trying to compare the performance difference between DELETE batch sizes using JMeter.

我有一个表格,其中填充了大量测试数据.接下来,我有一个运行以下语句的JDBC请求:

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.

  1. 我应该如何定义While控制器来实现此目标?

  1. 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?

推荐答案

  1. 添加交易控制器作为其下的顶级测试元素线程组
  2. 同时使用控制器添加为事务控制器的子代并使用以下条件表达式:

  1. Add Transaction Controller to be a top level test element under the Thread Group
  2. Add While Controller as a child of the Transaction Controller and use the following condition expression:

${__jexl3(${count_1} > 0,)}

  • 将您的JDBC Request采样器放置为While控制器的子代
  • JDBC PostProcessor 添加为JDBC请求的子代采样器,并将其配置为:

  • 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:

    就是这样,虽然Controller会进行迭代,直到tbl表中存在条目,并且Transaction Controller将记录所有已执行的JDBC Request采样器的累积时间.

    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.

    这篇关于JMeter:如何对从数据库表中的数据删除进行批量基准测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆