JMeter Maven Mojo抛出带有大型JTL文件的IllegalArgumentException [英] JMeter Maven mojo throws IllegalArgumentException with large JTL file

查看:167
本文介绍了JMeter Maven Mojo抛出带有大型JTL文件的IllegalArgumentException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在线程组上运行具有大量循环计数(对15个HTTP请求进行100次迭代)的JMeter测试时,我从JMeter中得到了一个巨大的JTL文件.

When I run my JMeter test with a large loop count (100 iterations on 15 HTTP requests) on my thread group I get an enormous JTL file out of JMeter.

这是我正在使用的jmeter-maven-plugin的问题( https://github.com/jmeter-maven-plugin/jmeter-maven-plugin ),它使用java.util.Scanner扫描JTL文件以查找"false",以查看测试是否失败.由于文件太大(1.8GB),因此出现以下故障.

This is a problem for the jmeter-maven-plugin I'm using (https://github.com/jmeter-maven-plugin/jmeter-maven-plugin) which uses a java.util.Scanner to scan the JTL file looking for "false" to see if the tests fail. Because the file is so big (1.8GB) I get the following failure.

[ERROR] Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:1.10.1:jmeter (jmeter-tests) on project performance-tests: Execution jmeter-tests of goal com.lazerycode.jmeter:jmeter-maven-plugin:1.10.1:jmeter failed. IllegalArgumentException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:1.10.1:jmeter (jmeter-tests) on project performance-tests: Execution jmeter-tests of goal com.lazerycode.jmeter:jmeter-maven-plugin:1.10.1:jmeter failed.
       at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
       at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
       at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
       at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
       at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
       at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
       at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
       at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
       at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:497)
       at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
       at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
       at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
       at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution jmeter-tests of goal com.lazerycode.jmeter:jmeter-maven-plugin:1.10.1:jmeter failed.
       at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
       at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
       ... 20 more
Caused by: java.lang.IllegalArgumentException
       at java.nio.CharBuffer.allocate(CharBuffer.java:334)
       at java.util.Scanner.makeSpace(Scanner.java:840)
       at java.util.Scanner.readInput(Scanner.java:795)
       at java.util.Scanner.findWithinHorizon(Scanner.java:1685)
       at com.lazerycode.jmeter.FailureScanner.hasTestFailed(FailureScanner.java:36)
       at com.lazerycode.jmeter.JMeterMojo.parseTestResults(JMeterMojo.java:70)
       at com.lazerycode.jmeter.JMeterMojo.execute(JMeterMojo.java:54)
       at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
       ... 21 more

我正在使用ignoreResultFailures = true作为jmeter-maven-plugin的参数来解决此问题,这避免了使用java.util.Scanner进行失败的尝试.理想情况下,jmeter-maven-plugin可以处理非常大的JTL文件,但是JTL文件的大小似乎有点极端.

I'm working around this using ignoreResultFailures = true as a parameter to the jmeter-maven-plugin which avoids it using the java.util.Scanner and failing. Ideally the jmeter-maven-plugin would handle the very large JTL file, but the size of the JTL file seems a bit extreme.

有没有可以减少JTL文件大小的JMeter设置?

Are there any JMeter settings that can reduce the size of the JTL file?

推荐答案

检查您的测试计划是否启用了功能测试模式".

Check to see if your test plan has "Functional Test Mode" enabled.

http://jmeter.apache.org/usermanual/listeners.html

要保存的信息是可配置的.要获取更多信息, 选择"xml"作为格式,然后在 测试计划元素.如果未选中此框,则默认保存的数据 包括时间戳记(自午夜以来的毫秒数, 1970年1月1日UTC),数据类型,线程名称,标签, 响应时间,消息和代码以及成功指示符.如果选中, 所有信息,包括完整的响应数据,都将被记录.

The information to be saved is configurable. For maximum information, choose "xml" as the format and specify "Functional Test Mode" on the Test Plan element. If this box is not checked, the default saved data includes a time stamp (the number of milliseconds since midnight, January 1, 1970 UTC), the data type, the thread name, the label, the response time, message, and code, and a success indicator. If checked, all information, including the full response data will be logged.

如果选中,将保存所有详细的请求和响应数据,这将导致JTL文件大.也许您打开了此功能来调试测试,却忘记了将其关闭?

If checked, this will result in a large JTL file because all the verbose request and response data is saved. Maybe you turned this on to debug your tests and forgot to turn it off?

这篇关于JMeter Maven Mojo抛出带有大型JTL文件的IllegalArgumentException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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