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 BenchmarkParamsbooleanFlag that checks for time expiration.booleanFlag that checks for failure experienced by any measurement thread.final IterationParamsfinal booleanfinal Controlfinal CountDownLatchfinal CountDownLatchbooleanfinal CountDownLatchbooleanfinal AtomicIntegerfinal CountDownLatchbooleanfinal AtomicInteger -
Constructor Summary
ConstructorsConstructorDescriptionInfraControl(BenchmarkParams benchmarkParams, IterationParams iterationParams, CountDownLatch preSetup, CountDownLatch preTearDown, boolean lastIteration, 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
-
lastIteration
public final boolean lastIteration -
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 lastIteration, 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
-