JMeter 测试与 CLI 和 GUI 的工作方式不同 - 为什么? [英] JMeter test works differently from CLI than GUI - why?

查看:29
本文介绍了JMeter 测试与 CLI 和 GUI 的工作方式不同 - 为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 JMeter 创建一个小测试.到目前为止,我有一个线程组执行 HTTP 请求,等待 10 秒,然后执行另一个 HTTP 请求并检查返回的内容.如果我从 JMeter GUI 以 1 秒的加速周期启动 100 个这样的线程,它工作正常,我得到预期值并且整个测试在 22 秒内完成.但是,当我从命令行启动完全相同的 jmx 文件时,测试运行超过 120 秒,并且某些线程(在最后一次运行时,100 个中的 36 个)未获得预期值.这可能表明我测试的系统中存在错误,但我不明白为什么从 CLI 进行测试需要这么长时间,以及为什么我从 CLI 收到错误.从 GUI 和 CLI 运行测试有什么区别?CLI 是否更并行"地运行测试?顺便说一句,这是我正在使用的命令行:

I'm creating a small test using JMeter. So far I have one Thread Group that executes an HTTP request, waits for 10 seconds, then executes an other HTTP Request and checks what was returned. If I start 100 such threads with 1 second ramp-up period from the JMeter GUI, it works fine, I get the expected values and the whole test finishes in 22 seconds. However, when I start the very same jmx file from the command line, the test runs for more than 120 seconds and some threads (at the last run, 36 out of the 100) don't get the expected value. This might indicate a bug in the system I test, but I don't understand why the test takes that long time from the CLI and why I get errors from the CLI. What is the difference between running the test from the GUI and from the CLI? Does the CLI run the tests "more parallel"? By the way, this is the command line I'm using:

/home/nar/apache-jmeter-3.3/bin/jmeter -n -t test_transactions.jmx -l test_transactions.out

恐怕我不能分享测试计划,但我可以分享大纲":

I'm afraid I cannot share the test plan, but I can share the "outline":

+ Thread Group
  + CSV Data Set Config
  + HTTP Request
  | + JSON Extractor
  + Constant timer
  + HTTP Request
  | + JSON Extractor
  | + Response Assertion
  + View Results Tree
  + Save Responses to a file
  + View Results in Table
  + Summary Report

常量计时器等待 10 秒.第一个 HTTP 请求发送一些数据并启动计算,第二个检查结果.

The Constant timer waits for 10 seconds. The first HTTP Request sends in some data and initiates a computation, the second checks the result.

推荐答案

它实际上确实表明了被测系统中的错误.原因是你必须在非GUI模式下运行JMeterGUI 在资源消耗方面会产生巨大的开销,尤其是当您使用 侦听器,特别是如果其中之一是查看结果树.

It actually does indicate the bug in the system under test. The reason is that you must run JMeter in non-GUI mode as GUI creates huge overhead in terms of resources consumption, especially when you're using Listeners, especially if one of them is View Results Tree.

所以我的期望是,在非 GUI 模式下,您基本上会创建应用程序无法处理的更大负载.您可以使用 ie Active Threads Over Time每秒交易次数 听众.

So my expectation is that in non-GUI mode you're basically creating more immense load which your application cannot handle. You can check this out using i.e. Active Threads Over Time and Transactions Per Second listeners.

这篇关于JMeter 测试与 CLI 和 GUI 的工作方式不同 - 为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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