Prisco
Prisco

Reputation: 733

jmeter execution comparison with previous build in Jenkins

I am interested to publish jmeter report in Jenkins and set the pipeline as "failed" if there are degradation in terms of performances between the previous executions.

Below the configuration set in my Jenkinsfile for my jmeter results:

                perfReport filterRegex: '',
                        relativeFailedThresholdNegative: 0,
                        relativeFailedThresholdPositive: 0,
                        relativeUnstableThresholdNegative: 0,
                        relativeUnstableThresholdPositive: 0,
                        sourceDataFiles: 'resultsJmeter/output/*.xml'
                    }

Is there any way to evaluate automatically the previous executions (if any) ?

Upvotes: 4

Views: 1160

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

As per Performance Trend Reporting article:

You can configure the error percentage thresholds and the relative percentage thresholds which would make the project unstable or failed or set them to -1 to disable the feature

As per How to Use the Jenkins Performance Plugin

enter image description here

Set the following values:

Unstable: 10
Failed: 60

This configuration will mark the build as unstable when errors are at 10% and as failed when 60% of our requests failed.

The relevant pipeline syntax would be:

perfReport errorFailedThreshold: 60, errorUnstableThreshold: 10, filterRegex: '', sourceDataFiles: 'resultsJmeter/output/*.xml'

for the relative to the previous build:

perfReport relativeFailedThresholdNegative: 10, relativeFailedThresholdPositive: 60, relativeUnstableThresholdNegative: 5, relativeUnstableThresholdPositive: 30, sourceDataFiles: 'resultsJmeter/output/*.xml', filterRegex: ''

Upvotes: 4

Related Questions