Home

Awesome

Jenkins JMH Report Plugin

Visually explore your JMH benchmarks on Jenkins!

Based on JMH Visualizer.

Given your project runs JMH benchmarks, you can use this plugin to visualize the results of it. The results need to be stored in JSON therefore.

Build Status

Setup in Jenkins

As a pipeline step

jmhReport 'build/reports/jmh/result.json'

OR

step([$class: 'RunPublisher', resultPath: 'build/reports/jmh/result.json'])

A complete pipeline could look like that:

node {
    checkout([$class: 'GitSCM', branches: [[name: '*/master']], userRemoteConfigs: [[url: 'https://github.com/ben-manes/caffeine.git']]])
    sh './gradlew jmh -PincludePattern=".*DelegationBenchmark.*"'
    jmhReport 'caffeine/build/reports/jmh/results.json'
}

As a post-build action

post-build action

As a Job-DSL-Plugin

jmhReport { resultPath('build/reports/jmh/result.json') }

A complete job-dsl example could look like that:

job('example-1') {
    steps {
        scm {
            git("https://github.com/ben-manes/caffeine.git", "master")
        }
        shell('./gradlew jmh -PincludePattern=".*DelegationBenchmark.*"')
        publishers {
            jmhReport {
                resultPath('build/reports/jmh/result.json')
            }
        }
    }
}

Building the project

Releasing the project