public abstract class JmhBenchmarkState extends Object implements hudson.model.RootAction
State
for JMH when a Jenkins instance is required.
To use a Jenkins instance in your benchmark, your class containing benchmarks should have a public static inner
class that extends this class and should be annotated with JmhBenchmark
to allow it to be automatically
discovered by BenchmarkFinder
. To configure the instance, use setup()
.
setup()
,
tearDown()
,
BenchmarkFinder
Constructor and Description |
---|
JmhBenchmarkState() |
Modifier and Type | Method and Description |
---|---|
String |
getDisplayName() |
String |
getIconFileName() |
jenkins.model.Jenkins |
getJenkins()
Get reference to the
Jenkins started for the benchmark. |
String |
getUrlName() |
void |
setup()
Override to setup resources required for the benchmark.
|
void |
setupJenkins()
Sets up the temporary Jenkins instance for benchmarks.
|
void |
tearDown()
Override to perform cleanup of resource initialized during setup.
|
void |
terminateJenkins()
Terminates the jenkins instance after the benchmark has completed its execution.
|
public final void setupJenkins() throws Exception
One Jenkins instance is created for each fork of the benchmark.
Exception
- if unable to start the instance.public final void terminateJenkins()
public jenkins.model.Jenkins getJenkins()
Jenkins
started for the benchmark.
The instance can also be obtained using Jenkins.getInstanceOrNull()
public void setup() throws Exception
Runs before the benchmarks are run. At this state, the Jenkins instance
is ready to be worked upon and is available using getJenkins()
.
Does nothing by default.
Exception
public void tearDown()
Run before the Jenkins instance is terminated. Does nothing by default.
@CheckForNull public String getIconFileName()
getIconFileName
in interface hudson.model.Action
@CheckForNull public String getDisplayName()
getDisplayName
in interface hudson.model.Action
getDisplayName
in interface hudson.model.ModelObject
@CheckForNull public String getUrlName()
getUrlName
in interface hudson.model.Action
Copyright © 2004–2022. All rights reserved.