【P30】JMeter transaction controller (Transaction Controller)


1. Transaction Controller parameter description

可以生成一个额外的样本,这样能够将它的所有子元素作为一个计量单元进行监听;事务控制器本身不包含任何业务逻辑,只是组合出一个新的计量单元

Select the right button of the thread group >>> Add >>> Logic Controller >>> Transaction Controller (Transaction Controller)

insert image description here

  • Generate parent sample: Selected, the transaction controller will be displayed as the parent sampler of other samplers (the aggregation report will count the execution status of the transaction controller and the samplers under it, and finally only the transaction controller will be used as the result of the statistics ); not selected, the transaction controller is only displayed as an independent sampler (all samplers (interfaces, transaction controllers) are counted)

  • Include duration of timer and pre-post processors in generated sample: Whether to count the delay time including timer, pre-processing and post-processing in the generated sampler. Default is unchecked

2. Test plan design

(1), right click on the test plan <<< add <<< thread (user) <<< thread group

insert image description here

  • Check to continue

- Number of cycles: 10000

  • Check Same user on each iteration

(2), right click on the thread group <<< add <<< sampler <<< debug sampler

insert image description here

  • Name: Debug Sampler-1

(3), right click on the thread group <<< add <<< sampler <<< debug sampler

insert image description here

  • Name: Debug Sampler-2

(4), right click on the thread group <<< add <<< listener <<< aggregation report

(5) Click the start button to view the aggregation report

insert image description here

如图:有两个 调试取样器 及一个 总体

(6), right click on the thread group <<< add <<< logic controller <<< transaction controller, put two debug samplers under the transaction controller

insert image description here

(7). Click Clear All, click Start, and click Aggregate Report to view

insert image description here

如图:多了一个 事务控制器 样本,通过 事务控制器 组合出来的

2.2.1. Check Generate parent sample

(1), Modify the transaction controller, check Generate parent sample

insert image description here

  • Check Generate parent sample

(2) Click Clear All, click Start, and click Aggregate Report to view

insert image description here

事务控制器将作为其他取样器的父级取样器进行展示(聚合报告会将事务控制器及其下的取样器执行情况均统计,最终仅以事务控制器作为结果统计出来)

如果业务请求较多,在进行压测时,只想看总的结果,可以使用 事务控制器

2.2.1、勾选 Include duration of timer and pre-post processors in generated sample

(1) Modify the transaction controller, check Include duration of timer and pre-post processors in generated sample

insert image description here

  • Check Generate parent sample

  • 勾选 Include duration of timer and pre-post processors in generated sample

(2) Click Clear All, click Start, and click Aggregate Report to view

insert image description here

如图,每个样本的百分位、最大最小值基本为0

(3), right click on the transaction controller <<< add <<< timer <<< fixed timer

insert image description here

(4) Click Clear All, click Start, and click Aggregate Report to view

insert image description here

如图,勾选 Include duration of timer and pre-post processors in generated sample 后,会统计 固定定时器 的时间,一个 调试取样器 执行 一次 固定定时器,所以,每个样本的百分位、最大最小值大概是 2s 多

Guess you like

Origin blog.csdn.net/qq_45138120/article/details/130873255