Package jenkins.benchmark.jmh
Class JmhBenchmarkState
java.lang.Object
jenkins.benchmark.jmh.JmhBenchmarkState
- All Implemented Interfaces:
- hudson.ExtensionPoint,- hudson.model.Action,- hudson.model.ModelObject,- hudson.model.RootAction
Standard benchmark 
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().
- Since:
- 2.50
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface hudson.ExtensionPointhudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionjenkins.model.JenkinsGet reference to theJenkinsstarted for the benchmark.voidsetup()Override to setup resources required for the benchmark.final voidSets up the temporary Jenkins instance for benchmarks.voidtearDown()Override to perform cleanup of resource initialized during setup.final voidTerminates the jenkins instance after the benchmark has completed its execution.
- 
Constructor Details- 
JmhBenchmarkStatepublic JmhBenchmarkState()
 
- 
- 
Method Details- 
setupJenkinsSets up the temporary Jenkins instance for benchmarks.One Jenkins instance is created for each fork of the benchmark. - Throws:
- Exception- if unable to start the instance.
 
- 
terminateJenkinspublic final void terminateJenkins()Terminates the jenkins instance after the benchmark has completed its execution. Run once for each Jenkins that was started.
- 
getJenkinspublic jenkins.model.Jenkins getJenkins()Get reference to theJenkinsstarted for the benchmark.The instance can also be obtained using Jenkins.getInstanceOrNull()- Returns:
- the Jenkins instance started for the benchmark.
 
- 
setupOverride to setup resources required for the benchmark.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.- Throws:
- Exception
 
- 
tearDownpublic void tearDown()Override to perform cleanup of resource initialized during setup.Run before the Jenkins instance is terminated. Does nothing by default. 
- 
getIconFileName- Specified by:
- getIconFileNamein interface- hudson.model.Action
 
- 
getDisplayName- Specified by:
- getDisplayNamein interface- hudson.model.Action
- Specified by:
- getDisplayNamein interface- hudson.model.ModelObject
 
- 
getUrlName- Specified by:
- getUrlNamein interface- hudson.model.Action
 
 
-