gpt4 book ai didi

maven - jmeter 分析插件 IllegalArgumentException : Null or zero length 'values' argument

转载 作者:行者123 更新时间:2023-12-01 10:04:18 24 4
gpt4 key购买 nike

运行 jmeter-analysis 插件时出现非法参数异常。我已经验证了所有输出 .jtl 文件,而且 xml 文件似乎没有格式错误。下面我发布了我用来运行性能测试套件 (运行良好) 的 maven 命令,以及我的项目结构、pom 和输出。我不太清楚发生了什么,因为在我更新 .jmx 中的 JMeter 测试计划之前,一切实际上都在工作。该套件在 JMeter GUI 中运行良好,并且在进入分析步骤之前运行良好。有没有人遇到过这个?我能做些什么来解决这个问题?

maven

mvn -pl performance-tests clean verify -U -X

项目结构

Project
Performance Test Module
src
test
jmeter
performance-tests.jmx
resources
properties
artifact_headers.properties
artifact_users.properties
index.html

POM

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>artifact-id</artifactId>
<groupId>com.group.id</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>performance-tests</artifactId>

<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<threads>1</threads>
<loops>1</loops>
<ramp>1</ramp>
<delay>1</delay>
<account></account>
<password></password>
</properties>
</profile>
</profiles>

<properties>
<com.artifact.jmeter.test>${project.basedir}/src/test/jmeter/*.jmx</com.artifact.jmeter.test>
<com.artifact.target.environment>https://dev-dot-api-dot-labs-horizon-1.appspot.com</com.artifact.target.environment>
<com.artifact.jmeter.loops>${loops}</com.artifact.jmeter.loops>
<com.artifact.jmeter.threads>${threads}</com.artifact.jmeter.threads>
<com.artifact.jmeter.ramp>${ramp}</com.artifact.jmeter.ramp>
<com.artifact.jmeter.startup.delay>${delay}</com.artifact.jmeter.startup.delay>
<com.artifact.jmeter.account>${account}</com.artifact.jmeter.account>
<com.artifact.jmeter.password>${password}</com.artifact.jmeter.password>
<reportdirectory>${project.build.directory}/results</reportdirectory>
<kg.apc.version>1.4.0</kg.apc.version>
<commons.lang.version>2.6</commons.lang.version>
<net.minidev.version>2.3</net.minidev.version>
<surefire.version>2.19.1</surefire.version>
</properties>

<dependencies>
<dependency>
<groupId>com.vault</groupId>
<artifactId>vault-lib</artifactId>
<version>2.13</version>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>${surefire.version}</version>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>${net.minidev.version}</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commons.lang.version}</version>
</dependency>
<dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-standard</artifactId>
<version>${kg.apc.version}</version>
</dependency>
<dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-extras</artifactId>
<version>${kg.apc.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.0.3</version>
<executions>
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<customPropertiesFiles>
<file>${project.build.directory}/jmeter/bin/properties/artifact_headers.properties</file>
<file>${project.build.directory}/jmeter/bin/properties/artifact_users.properties</file>
</customPropertiesFiles>
<propertiesFilesDirectory>${project.build.directory}/jmeter/bin/properties</propertiesFilesDirectory>
<jmeterExtensions>
<extension>commons-lang:commons-lang:2.6</extension>
<extension>net.minidev:json-smart:2.3</extension>
<artifact>kg.apc:jmeter-plugins-standard:1.4.0</artifact>
<artifact>kg.apc:jmeter-plugins-extras:1.4.0</artifact>
<artifact>kg.apc:jmeter-plugins-extras-libs:1.4.0</artifact>
<artifact>org.apache.jmeter:jorphan:3.0</artifact>
</jmeterExtensions>
<propertiesUser>
<jmeter.loops>${com.artifact.jmeter.loops}</jmeter.loops>
<jmeter.threads>${com.artifact.jmeter.threads}</jmeter.threads>
<jmeter.ramp>${com.artifact.jmeter.ramp}</jmeter.ramp>
<jmeter.account>${com.artifact.jmeter.account}</jmeter.account>
<jmeter.password>${com.artifact.jmeter.password}</jmeter.password>
<RESULTS_PATH>${reportdirectory}</RESULTS_PATH>
</propertiesUser>
<propertiesJMeter>
<aggregate_rpt_pct1>80</aggregate_rpt_pct1>
<aggregate_rpt_pct2>90</aggregate_rpt_pct2>
<aggregate_rpt_pct3>99</aggregate_rpt_pct3>
</propertiesJMeter>
<overrideRootLogLevel>warning</overrideRootLogLevel>
<testResultsTimestamp>false</testResultsTimestamp>
<!--<resultsFileFormat>csv</resultsFileFormat>-->
<resultsDirectory>${reportdirectory}</resultsDirectory>
</configuration>
</plugin>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-analysis-maven-plugin</artifactId>
<version>1.0.6</version>
<executions>
<execution>
<phase>verify</phase>
<id>thread</id>
<goals>
<goal>analyze</goal>
</goals>
<configuration>
<!--<source>${project.build.directory}/**/*.jtl</source>-->
<source>${reportdirectory}/performance-tests.jtl</source>
<targetDirectory>${reportdirectory}/generatedreport</targetDirectory>
<sourceDirFailed>false</sourceDirFailed>
<checkResult>
<throughput>
<threshold>-1</threshold>
<toleranceDirection>UPPER_LOWER_TOLERANCE</toleranceDirection>
<tolerance>5</tolerance>
</throughput>
<errors>
<threshold>-1</threshold>
<toleranceDirection>UPPER_LOWER_TOLERANCE</toleranceDirection>
<tolerance>5</tolerance>
</errors>
</checkResult>
<configurationCharts>
<width>950</width>
<height>500</height>
</configurationCharts>
<maxSamples>50000</maxSamples>
<preserveDirectories>false</preserveDirectories>
<sampleNames>
<sampleName>sample</sampleName>
<sampleName>httpSample</sampleName>
</sampleNames>
<processAllFilesFound>true</processAllFilesFound>
<remoteResourcesFromUntilDateFormat>HH:mm_yyyyMMdd</remoteResourcesFromUntilDateFormat>
<writers>
<!--<com.lazerycode.jmeter.analyzer.writer.SummaryTextToStdOutWriter/>-->
<!--<com.lazerycode.jmeter.analyzer.writer.SummaryTextToFileWriter/>-->
<!--<com.lazerycode.jmeter.analyzer.writer.HtmlWriter/>-->
<!--<com.lazerycode.jmeter.analyzer.writer.DetailsToCsvWriter/>-->
<com.lazerycode.jmeter.analyzer.writer.DetailsToHtmlWriter/>
<com.lazerycode.jmeter.analyzer.writer.ChartWriter/>
</writers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/jmeter/bin</outputDirectory>
<resources>
<resource>
<directory>${pom.basedir}/src/test/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

堆栈跟踪

[ERROR] Failed to execute goal com.lazerycode.jmeter:jmeter-analysis-maven-plugin:1.0.6:analyze (thread) on project performance-tests: Error analysing: Null or zero length 'values' argument. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.lazerycode.jmeter:jmeter-analysis-maven-plugin:1.0.6:analyze (thread) on project performance-tests: Error analysing
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
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:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
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:498)
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)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error analysing
at com.lazerycode.jmeter.analyzer.AnalyzeMojo.execute(AnalyzeMojo.java:233)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 21 more
Caused by: java.lang.IllegalArgumentException: Null or zero length 'values' argument.
at org.jfree.data.statistics.HistogramDataset.getMinimum(HistogramDataset.java:221)
at org.jfree.data.statistics.HistogramDataset.addSeries(HistogramDataset.java:136)
at com.lazerycode.jmeter.analyzer.writer.ChartWriter.createResponseTimesPlot(ChartWriter.java:188)
at com.lazerycode.jmeter.analyzer.writer.ChartWriter.writeCharts(ChartWriter.java:95)
at com.lazerycode.jmeter.analyzer.writer.ChartWriter.write(ChartWriter.java:65)
at com.lazerycode.jmeter.analyzer.ResultAnalyzer.analyze(ResultAnalyzer.java:47)
at com.lazerycode.jmeter.analyzer.AnalyzeMojo.analyze(AnalyzeMojo.java:318)
at com.lazerycode.jmeter.analyzer.AnalyzeMojo.execute(AnalyzeMojo.java:217)
... 23 more

最佳答案

I have downloaded the plugin and see the exception is happening with ChartWriter component when it doesn't have 'values' to generate charts (I think).

To by-pass it without changing code, you can disable ChartWriter (if you not really need it) by changing in pom as below.

<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-analysis-maven-plugin</artifactId>
<version>1.0.6</version>
<executions>
<execution>
<id>create-html-report</id>
<phase>test</phase>
<configuration>
<processAllFilesFound>true</processAllFilesFound>
<source>${project.build.directory}/**/*.jtl</source>
<writers>
<com.lazerycode.jmeter.analyzer.writer.SummaryTextToStdOutWriter/>
<com.lazerycode.jmeter.analyzer.writer.SummaryTextToFileWriter/>
<com.lazerycode.jmeter.analyzer.writer.HtmlWriter/>
<com.lazerycode.jmeter.analyzer.writer.DetailsToCsvWriter/>
<com.lazerycode.jmeter.analyzer.writer.DetailsToHtmlWriter/>
**<!--<com.lazerycode.jmeter.analyzer.writer.ChartWriter/>-->**
</writers>

</configuration>
<goals>
<goal>analyze</goal>
</goals>
</execution>
</executions>
</plugin>

关于maven - jmeter 分析插件 IllegalArgumentException : Null or zero length 'values' argument,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44681382/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com