-
-
Notifications
You must be signed in to change notification settings - Fork 235
Generating Reports
Vincent DABURON edited this page Nov 7, 2024
·
8 revisions
JMeter now supports the ability to generate reports, as a result you can do the same with this plugin.
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>3.6.0</version>
<executions>
<!-- Generate JMeter configuration -->
<execution>
<id>configuration</id>
<goals>
<goal>configure</goal>
</goals>
</execution>
<!-- Run JMeter tests -->
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
<!-- Fail build on errors in test -->
<execution>
<id>jmeter-check-results</id>
<goals>
<goal>results</goal>
</goals>
</execution>
</executions>
<configuration>
<generateReports>true</generateReports>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
Note: JMeter only supports report generation if your results file format is CSV. As a result enabling <generateReports>true</generateReports>
will result in your results file format automatically being changed to CSV format even if you have explicitly set it to XML format!
By default the result directory is set to "${project.build.directory}/jmeter/reports" but you can change the report directory with add to configuration <reportDirectory>${project.build.directory}/report-new-directory</reportDirectory>
.
You could use the maven variable ${maven.build.timestamp}
to add the timestamp in the report directory name.
- Change the timestamp format without character':' likes <properties><maven.build.timestamp.format>yyyy-MM-dd'T'HH'h'mm'm'ss's'</maven.build.timestamp.format></properties>
- In the configuration, set the reportDirectory likes : <reportDirectory>${project.build.directory}/report-${maven.build.timestamp}</reportDirectory> , e.g directory name : target/report-2024-11-07T11h19m21s