class BenchmarkHandler
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
BenchmarkHandler.BenchmarkTask
Worker body.
|
private static class |
BenchmarkHandler.ExecutorType |
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.ExecutorService |
executor
Thread-pool for threads executing the benchmark tasks
|
private static BenchmarkHandler.ExecutorType |
EXECUTOR_TYPE |
private java.lang.ThreadLocal<java.lang.Object> |
instances |
private java.lang.reflect.Method |
method |
private OutputFormat |
out |
private java.util.List<InternalProfiler> |
profilers |
private java.util.List<InternalProfiler> |
profilersRev |
Constructor and Description |
---|
BenchmarkHandler(OutputFormat out,
Options options,
BenchmarkParams executionParams) |
Modifier and Type | Method and Description |
---|---|
(package private) static ThreadParams[] |
distributeThreads(int threads,
int[] groups) |
static java.lang.reflect.Method |
findBenchmarkMethod(java.lang.Class<?> clazz,
java.lang.String methodName) |
private static boolean |
isValidBenchmarkSignature(java.lang.reflect.Method m)
checks if method signature is valid benchmark signature,
besited checks if method signature corresponds to benchmark type.
|
IterationResult |
runIteration(BenchmarkParams benchmarkParams,
IterationParams params,
boolean last)
Runs an iteration on the handled benchmark.
|
void |
shutdown()
Do required shutdown actions.
|
protected void |
startProfilers(BenchmarkParams benchmarkParams,
IterationParams iterationParams) |
protected void |
stopProfilers(BenchmarkParams benchmarkParams,
IterationParams iterationParams,
IterationResult iterationResults) |
private final java.util.concurrent.ExecutorService executor
private final java.lang.ThreadLocal<java.lang.Object> instances
private final OutputFormat out
private final java.util.List<InternalProfiler> profilers
private final java.util.List<InternalProfiler> profilersRev
private final java.lang.reflect.Method method
private static final BenchmarkHandler.ExecutorType EXECUTOR_TYPE
public BenchmarkHandler(OutputFormat out, Options options, BenchmarkParams executionParams)
static ThreadParams[] distributeThreads(int threads, int[] groups)
public static java.lang.reflect.Method findBenchmarkMethod(java.lang.Class<?> clazz, java.lang.String methodName)
private static boolean isValidBenchmarkSignature(java.lang.reflect.Method m)
m
- protected void startProfilers(BenchmarkParams benchmarkParams, IterationParams iterationParams)
protected void stopProfilers(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult iterationResults)
public void shutdown()
public IterationResult runIteration(BenchmarkParams benchmarkParams, IterationParams params, boolean last)
benchmarkParams
- Benchmark parametersparams
- Iteration parameterslast
- Should this iteration considered to be the last