我在 maven 中使用 jmeter-graph-maven-plugin 来生成图表报告。我已将插件配置为在每次执行中将单个 jtl 文件作为输入,但在第一次执行中仅运行第一个输入文件后会生成报告,具有 jtl 文件的剩余执行不会生成任何图形。下面是我在 pom 文件中的插件配置。
<plugin>
<groupId>de.codecentric</groupId>
<artifactId>jmeter-graph-maven-plugin</artifactId>
<version>0.1.0</version>
<executions>
<execution>
<id>create-graphs-1</id>
<goals>
<goal>create-graph</goal>
</goals>
<phase>verify</phase>
<configuration>
<inputFile>${project.build.directory}/jmeter/results/catlyst2-10users.jtl</inputFile>
<graphs>
<graph>
<pluginType>ThreadsStateOverTime</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ThreadsStateOverTime-10user.png</outputFile>
</graph>
<graph>
<pluginType>ResponseTimesOverTime</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseTimesOverTime-10user.png</outputFile>
</graph>
<graph>
<pluginType>TransactionsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/TransactionsPerSecond-10user.png</outputFile>
</graph>
<graph>
<pluginType>HitsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/HitsPerSecond-10user.png</outputFile>
</graph>
<graph>
<pluginType>BytesThroughputOverTime</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/BytesThroughputOverTime-10user.png</outputFile>
</graph>
<graph>
<pluginType>LatenciesOverTime</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/LatenciesOverTime-10user.png</outputFile>
</graph>
<graph>
<pluginType>ResponseCodesPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseCodesPerSecond-10user.png</outputFile>
</graph>
<graph>
<pluginType>ResponseTimesDistribution</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseTimesDistribution-10user.png</outputFile>
</graph>
<graph>
<pluginType>ResponseTimesPercentiles</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseTimesPercentiles-10user.png</outputFile>
</graph>
<graph>
<pluginType>TimesVsThreads</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/TimesVsThreads-10user.png</outputFile>
</graph>
<graph>
<pluginType>ThroughputVsThreads</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ThroughputVsThreads-10user.png</outputFile>
</graph>
</graphs>
<processAllFilesFound>true</processAllFilesFound>
</configuration>
</execution>
<execution>
<id>create-graphs-2</id>
<configuration>
<inputFile>${project.build.directory}/jmeter/results/catlyst2-20users.jtl</inputFile>
<graphs>
<graph>
<pluginType>ThreadsStateOverTime</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ThreadsStateOverTime-20users.png</outputFile>
</graph>
<graph>
<pluginType>ResponseTimesOverTime</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseTimesOverTime-20users.png</outputFile>
</graph>
<graph>
<pluginType>TransactionsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/TransactionsPerSecond-20users.png</outputFile>
</graph>
<graph>
<pluginType>HitsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/HitsPerSecond-20users.png</outputFile>
</graph>
<graph>
<pluginType>BytesThroughputOverTime</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/BytesThroughputOverTime-20users.png</outputFile>
</graph>
<graph>
<pluginType>LatenciesOverTime</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/LatenciesOverTime-20users.png</outputFile>
</graph>
<graph>
<pluginType>ResponseCodesPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseCodesPerSecond-20users.png</outputFile>
</graph>
<graph>
<pluginType>ResponseTimesDistribution</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseTimesDistribution-20users.png</outputFile>
</graph>
<graph>
<pluginType>ResponseTimesPercentiles</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseTimesPercentiles-20users.png</outputFile>
</graph>
<graph>
<pluginType>TimesVsThreads</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/TimesVsThreads-20users.png</outputFile>
</graph>
<graph>
<pluginType>ThroughputVsThreads</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ThroughputVsThreads-20users.png</outputFile>
</graph>
</graphs>
<processAllFilesFound>true</processAllFilesFound>
</configuration>
</execution>
<execution>
<id>create-graphs-3</id>
<configuration>
<inputFile>${project.build.directory}/jmeter/results/catlyst2-30users.jtl</inputFile>
<graphs>
<graph>
<pluginType>ThreadsStateOverTime</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ThreadsStateOverTime-30users.png</outputFile>
</graph>
<graph>
<pluginType>ResponseTimesOverTime</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseTimesOverTime-30users.png</outputFile>
</graph>
<graph>
<pluginType>TransactionsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/TransactionsPerSecond-30users.png</outputFile>
</graph>
<graph>
<pluginType>HitsPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/HitsPerSecond-30users.png</outputFile>
</graph>
<graph>
<pluginType>BytesThroughputOverTime</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/BytesThroughputOverTime-30users.png</outputFile>
</graph>
<graph>
<pluginType>LatenciesOverTime</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/LatenciesOverTime-30users.png</outputFile>
</graph>
<graph>
<pluginType>ResponseCodesPerSecond</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseCodesPerSecond-30users.png</outputFile>
</graph>
<graph>
<pluginType>ResponseTimesDistribution</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseTimesDistribution-30users.png</outputFile>
</graph>
<graph>
<pluginType>ResponseTimesPercentiles</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ResponseTimesPercentiles-30users.png</outputFile>
</graph>
<graph>
<pluginType>TimesVsThreads</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/TimesVsThreads-30users.png</outputFile>
</graph>
<graph>
<pluginType>ThroughputVsThreads</pluginType>
<width>800</width>
<height>600</height>
<outputFile>${project.build.directory}/jmeter/results/ThroughputVsThreads-30users.png</outputFile>
</graph>
</graphs>
</configuration>
</execution>
</executions>
</plugin>
}