java - Jmeter 多次执行来自 CSV 的每条记录

标签 java jmeter load-testing

我有一个包含 100 条记录/行的 CSV,我希望使用 JMeter 执行(通过服务)。

现在,我想对每条记录执行 3 次(每次延迟 5 秒),并对 CSV 中的所有 100 条记录执行相同的操作。

我如何使用 JMeter 做到这一点?

最佳答案

使用 jmeter 的 standard components 看起来并不难实现.

  1. 使用正确配置的 CSV Data Set ConfigWhile Controller 下从您的 csv 文件中读取所有条目。
  2. 在同一个循环中使用Loop Controller设置为所需的循环计数 - 这将使用从每个 csv 条目中提取的变量重复您的请求 N 次。
  3. Under Loop Controller 使用合适 sampler ,例如HTTP Request Sampler , 用来自 csv-entry 的参数发送您的请求。
  4. 与采样器一起使用任何 timer ,例如Constant Timer , 在每个请求后添加延迟。

架构可能如下所示:

Thread Group
Number of Threads = 1   
Loop Count = 1
    . . .
    While Controller                 // this will iterate through your csv-file
    Condition = ${__javaScript("${var1}"!="",)}  // this will repeat until EOF
        CSV Data Set Config
        Filename = ...               // path to your csv file
        Variable Names = var1,...    // these are records read from file into pointed variables
        Delimiter = ,
        Recycle on EOF? = False
        Stop thread on EOF? = True
        Sharing Mode = Current thread group

        Loop Controller
        Loop Count = 3
            HTTP Request Sampler
            Constant Timer
            Thread Delay (in ms) = 5000
        . . .

关于java - Jmeter 多次执行来自 CSV 的每条记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12294680/

相关文章:

性能测试基础知识

java - SQL异常 : Could not retrieve transation read-only status server

读取文件时出现 java.nio.file.AccessDeniedException

java - 有没有办法在所有 spring 上下文初始化后调用 bean 中的方法

jquery - JMeter - 如何使用 jQuery(而非 CSS)提取器

jmeter - 加速期 0 vs 1

Java 正则表达式字符串 : Check if ip:port string contains a valid IPv4 or DNS address

redis - 使用 JMeter(使用 redis-dataset 插件)用 redis 哈希命中 redis 服务器

JSON 路径提取器 - 缺少 DummySampler

visual-studio-2010 - 1000个并发用户的负载测试