Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INFRA-2118] Add function to run JMH benchmarks #91

Merged
merged 3 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,22 @@ pct: "default"

*Please note that a blank metadata file will result in an error*

=== runBenchmarks

Runs JMH benchmarks and archives benchmark reports on `highmem` nodes.

Supported parameters:

`artifacts`::
(Optional) If `artifacts` is not null, invokes `archiveArtifacts` with the given string value.


===== Example
[source, groovy]
----
runBenchmarks('jmh-report.json')
----

=== Design documents for runATH and runPCT

The design and some more details about the runATH and runPCT steps can be found link:https://wiki.jenkins.io/display/JENKINS/runATH+and+runPCT+step+design[here]
30 changes: 30 additions & 0 deletions vars/runBenchmarks.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env groovy
AbhyudayaSharma marked this conversation as resolved.
Show resolved Hide resolved

/**
* Run JMH benchmarks and archives results
* @param artifacts archive these JMH reports
* @since TODO
*/
def call(String artifacts = null) {
lock('runBenchmarks') {
node('highmem') {

stage('Checkout repo') {
infra.checkout()
}

stage('Run Benchmarks') {
List<String> mvnOptions = ['test', '-Dbenchmark']
infra.runMaven(mvnOptions)
}

stage('Archive reports') {
if (artifacts != null) {
archiveArtifacts artifacts: artifacts
} else {
echo 'No artifacts to archive, skipping...'
}
}
}
}
}
22 changes: 22 additions & 0 deletions vars/runBenchmarks.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<p>
Runs JMH benchmarks and archives benchmark reports on <code>highmem</code> nodes.
</p>
<p>
Supported Parameters:
</p>

<dl>
<dt><code>artifacts</code></dt>
<dd>
(Optional) If <code>artifacts</code> is not null, invokes <code>archiveArtifacts</code>
with the given string value.
</dd>
</dl>

<p>
<b>Example:</b>
</p>

<pre>
runBenchmarks('jmh-report.json')
</pre>