Phil Harvey
Phil Harvey

Reputation: 1160

How to display performance test results on Jenkins

We've written a framework to test the performance of our Java application (none of the existing frameworks, eg JMeter, were appropriate). The framework produces various metrics, e.g. mean/min/max transactions per second.

We'd like each Jenkins build to display these metrics so that we can keep track of whether a commit has improved performance or not.

I can't figure out how to do this.

One idea is to modify our performance test framework to output a HTML file, then somehow make Jenkins display/link to it on the build results page.

Any advice gratefully received.

Upvotes: 23

Views: 31336

Answers (3)

Łukasz Rżanek
Łukasz Rżanek

Reputation: 5836

The Peformance Plugin can show the results of JMeter and JUnit test in the nice, graphical fashion. And on the plugin page there is a description on how to use it.

This is an open-source plugin hosted on GitHub. The JUnit and JMeter parser are already there, but You can implement your own just by subclassing PerformanceReportParser. It's pretty easy and you can just fork the repo and start your implementation.

Upvotes: 13

pushy
pushy

Reputation: 9645

You could use the HTML Publisher Plugin to publish the resulting HTML page. That would be pretty straightforward.

If you want better integration you could try to create output that follows the same format JMeter produces, and use the Performance Plugin.

For best result you could take Łukasz advice and modify the Performance Plugin to your needs. That requires the most effort on your part, of course.

Upvotes: 6

malenkiy_scot
malenkiy_scot

Reputation: 16615

I agree that it is hard (if not impossible) to squeeze all the information into standard formats, like JUnit. They are good for quick identification of problems. Once you know there is a problem - you need more information that is usually free-form or custom-formatted to fit your particular needs. So we use both: JUnit that can be immediately processed by Jenkins to decide if the build is stable or not, draw the nice trend graph, etc. We also produce an HTML report that is much more detailed.

Now to your immediate question: you can simply archive your HTML file as an artifact (there is a standard post-build step to do that). Then a link to it will be displayed among the artifacts for the build. There are permalinks to the latest artifacts and latest successful build artifacts:

http://[server]/job/[job_name]/lastCompletedBuild/artifact/foo.html
http://[server]/job/[job_name]/lastSuccessfulBuild/artifact/foo.html

You may bookmark those links and have quick and easy one-click access to your results.

Upvotes: 7

Related Questions