Class BenchmarkHandler
java.lang.Object
org.openjdk.jmh.runner.BenchmarkHandler
Base class for all benchmarks handlers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classWorker body.private static enumprivate static classHandles thread-local data for each worker that should not change between the iterations. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Class<?> private final ExecutorServiceThread-pool for threads executing the benchmark tasksprivate static final BenchmarkHandler.ExecutorTypeprivate final Methodprivate final OutputFormatprivate final List<InternalProfiler> private final List<InternalProfiler> private final BlockingQueue<ThreadParams> private final ConcurrentMap<Thread, BenchmarkHandler.WorkerData> -
Constructor Summary
ConstructorsConstructorDescriptionBenchmarkHandler(OutputFormat out, Options options, BenchmarkParams executionParams) -
Method Summary
Modifier and TypeMethodDescription(package private) static List<ThreadParams> distributeThreads(int threads, int[] groups) static MethodfindBenchmarkMethod(Class<?> clazz, String methodName) private static booleanchecks if method signature is valid benchmark signature, besited checks if method signature corresponds to benchmark type.private BenchmarkHandler.WorkerDatanewWorkerData(Thread worker) runIteration(BenchmarkParams benchmarkParams, IterationParams params, boolean last) Runs an iteration on the handled benchmark.voidshutdown()Do required shutdown actions.protected voidstartProfilers(BenchmarkParams benchmarkParams, IterationParams iterationParams) protected voidstopProfilers(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult iterationResults)
-
Field Details
-
executor
Thread-pool for threads executing the benchmark tasks -
workerData
-
tps
-
out
-
profilers
-
profilersRev
-
clazz
-
method
-
EXECUTOR_TYPE
-
-
Constructor Details
-
BenchmarkHandler
-
-
Method Details
-
distributeThreads
-
findBenchmarkMethod
-
isValidBenchmarkSignature
checks if method signature is valid benchmark signature, besited checks if method signature corresponds to benchmark type.- Parameters:
m-- Returns:
-
startProfilers
-
stopProfilers
protected void stopProfilers(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult iterationResults) -
shutdown
public void shutdown()Do required shutdown actions. -
runIteration
public IterationResult runIteration(BenchmarkParams benchmarkParams, IterationParams params, boolean last) Runs an iteration on the handled benchmark.- Parameters:
benchmarkParams- Benchmark parametersparams- Iteration parameterslast- Should this iteration considered to be the last- Returns:
- IterationResult
-
newWorkerData
-