Home

Awesome

JMeter SLA Report

1. Introduction

The 'jmeter-sla-report' is a replacement for the existing XSLT-based reporting backend when running JMeter from the command line to solve the following problems

This component was created when testing a large application using JMeter (see http://people.apache.org/~sgoeschl/presentations/apachecon-2011/jmeter.pdf)

2. Getting Started

In order to generate your first JMeter SLA reports run the following commands

> ant

> ls -l target/report-*.html
-rw-r--r--  1 sgoeschl  staff   11541 Apr 21 20:52 target/report-csv-success.html
-rw-r--r--  1 sgoeschl  staff   69738 Apr 21 20:52 target/report-xml-failure.html
-rw-r--r--  1 sgoeschl  staff  110686 Apr 21 20:52 target/report-xml-success.html

This uses dist/jmeter-sla-report-1.0.5.jar and generates three SLA reports using

whereas the following JMeter SLA reports are generated

Afterwards you see a report similar to the image below

JMeter HTML Report

3. ANT Integration

The following snippet is used to generate the JMeter SLA report

<!-- setup the class path to run the report -->
<path id="project.class.path">
    <fileset dir="${basedir}/lib">
        <include name="*.jar" />
    </fileset>
    <fileset dir="${basedir}/dist">
        <include name="jmeter-sla-report-1.0.5.jar" />
    </fileset>
</path>

<target name="report-xml-success" description="Report with XML JMeter file">
    <mkdir dir="${project.build.directory}" />
    <java classname="com.github.sgoeschl.jmeter.report.sla.Main" classpathref="project.class.path">
        <arg value="${project.build.directory}/report-xml-success.html" />
        <arg value="${basedir}/src/test/data/success.jtl" />
        <sysproperty key="jmeter.something" value="report-xml-success" />
    </java>
</target>

Let's dissect the ANT calls

4. Command Line Integration

Create a JMeter SLA Report based on jmeter.jtl file

java -jar ./dist/jmeter-sla-report-1.0.5-jar-with-dependencies.jar report.html src/test/data/success.jtl

Create a JMeter SLA Report based on one or more JTL files found in the given directory

java -jar ./dist/jmeter-sla-report-1.0.5-jar-with-dependencies.jar report.html ./src/test/data

5. The Implementation

A quick overview of the implementation

6. Current State