Package org.openjdk.jmh.runner
Class InfraControl
java.lang.Object
org.openjdk.jmh.runner.InfraControl
The InfraControl logic class.
This is the rendezvous class for benchmark handler and JMH.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal BenchmarkParamsfinal booleanbooleanFlag that checks for time expiration.booleanFlag that checks for failure experienced by any measurement thread.final IterationParamsfinal booleanfinal Controlfinal CountDownLatchfinal CountDownLatchfinal booleanbooleanfinal CountDownLatchbooleanfinal AtomicIntegerfinal CountDownLatchbooleanfinal AtomicInteger -
Constructor Summary
ConstructorsConstructorDescriptionInfraControl(BenchmarkParams benchmarkParams, IterationParams iterationParams, CountDownLatch preSetup, CountDownLatch preTearDown, boolean firstIteration, boolean lastIteration, boolean shouldYield, Control notifyControl) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidlonglonggetDuration(TimeUnit unit) booleanvoidpreSetup()voidvoidvoid
-
Field Details
-
isDone
public volatile boolean isDoneFlag that checks for time expiration. This is specifically the public field, so to spare one virtual call. -
isFailing
public volatile boolean isFailingFlag that checks for failure experienced by any measurement thread. This is specifically the public field, so to spare one virtual call. -
volatileSpoiler
public volatile boolean volatileSpoiler -
preSetup
-
preTearDown
-
firstIteration
public final boolean firstIteration -
lastIteration
public final boolean lastIteration -
shouldYield
public final boolean shouldYield -
warmupVisited
-
warmdownVisited
-
warmupShouldWait
public volatile boolean warmupShouldWait -
warmdownShouldWait
public volatile boolean warmdownShouldWait -
warmupDone
-
warmdownDone
-
benchmarkParams
-
iterationParams
-
notifyControl
-
-
Constructor Details
-
InfraControl
public InfraControl(BenchmarkParams benchmarkParams, IterationParams iterationParams, CountDownLatch preSetup, CountDownLatch preTearDown, boolean firstIteration, boolean lastIteration, boolean shouldYield, Control notifyControl)
-
-
Method Details
-
getDuration
public long getDuration()- Returns:
- requested loop duration in milliseconds.
-
getDuration
- Parameters:
unit- timeunit to use- Returns:
- requested loop duration in the requested unit.
-
preSetup
public void preSetup() -
preTearDown
public void preTearDown() -
preSetupForce
public void preSetupForce() -
preTearDownForce
public void preTearDownForce() -
isLastIteration
public boolean isLastIteration() -
announceDone
public void announceDone() -
announceWarmupReady
public void announceWarmupReady() -
announceWarmdownReady
public void announceWarmdownReady() -
awaitWarmupReady
public void awaitWarmupReady() -
awaitWarmdownReady
public void awaitWarmdownReady() -
getParam
-