Home

Awesome

jmeter-junit-reporter travis

Overview

Apache JMeter plugin for generating JUnit Reports in XML format, based on custom KPIs (Key Performance Indicators).

Each KPI will be reported as a test case with a status of success, failure, skipped or error.

KPIs can be defined as thresholds for response time aggregates such as average, median or a percentile.

The output format is compatible with Jenkins, as described here.

Example

reporter

Report

<?xml version="1.0" encoding="UTF-8"?>
<testsuite errors="0" failures="0" name="JUnit Reporter" skipped="0" tests="5">
  <testcase classname="Maximum Login time less than 5000ms"
            name="MAX(Login) &lt; 5000">
    <failure message="">Actual value 6230.000000 exceeds threshold 5000.000000 for samples matching "Login"</failure>
  </testcase>
  <testcase classname="90th Percentile less than 2000ms" name="P90(.*) &lt; 2000"/>
  <testcase classname="Average less than 1000ms" name="MEAN(.*) &lt; 1000"/>
  <testcase classname="At least 95% target throughput" name="HITS(.*) &gt;= 9500"/>
  <testcase classname="Not more than 1% sample errors" name="ERRORS(.*) &lt;= 0.01"/>
</testsuite>

Motivation

JMeter offers several kinds of results output including summary statistics and calls to backend databases/services. None of them can be directly interpreted by CI/CD pipelines to determine the pass or fail outcome of a performance test.

Instead, further processing with third-party tools is required. Examples are:

Those tools have additional installation requirements and may have to process possibly large *.jtl files.

This plugin instead processes each sample as it occurs, with little memory or storage requirements. Aggregates are calculated based on Apache Commons Math3 statistics with "storageless" implementations when sample sets are large.

Usage

JUnit Report File

KPI Definitions

Each row defines an aggregate metric to calculate for a set of samplers/transactions (matching the Label column) and to compare against a threshold.

Examples

NameMetricLabel (Regex)ComparatorThreshold
#1P50Web_.*<=1000
#2P50App_.*<=2000
#3HITS.*>=${__jexl3( 0.95 * ${RPS} * ${DURATION} )}

The first two KPIs are for the median (50th percentile) response time, for sample names beginning with "Web_" and "App_" with different thresholds (1000 and 2000 milliseconds, respectively).

The third KPI asserts a minimum of 95% overall throughput by defining a threshold for the total number of samples to compare with 95% of the product of requests per seconds and test duration (in seconds).

Configuration

JMeter Properties

The following properties control the plugin behaviour:

Installation

Via PluginsManager

Under tab "Available Plugins", select "JUnit Reporter", then click "Apply Changes and Restart JMeter".

Via Package from JMeter-Plugins.org

Extract the zip package into JMeter's lib directory, then restart JMeter.

Via Manual Download

  1. Copy the jmeter-junit-reporter jar file into JMeter's lib/ext directory.
  2. Restart JMeter.

Limitations