T - the type of task resultpublic abstract class Benchmark<T extends TaskResult>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Benchmark.MethodStatistics |
protected static class |
Benchmark.ProfileInput |
| Modifier and Type | Field and Description |
|---|---|
protected BaseParameters |
mBaseParameters |
| Constructor and Description |
|---|
Benchmark() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Perform post-run cleanups.
|
PlanConfig |
generateJobConfig(java.lang.String[] args)
Generate a
StressBenchConfig as the default JobConfig. |
abstract java.lang.String |
getBenchDescription()
Get the description of the bench.
|
protected static void |
mainInternal(java.lang.String[] args,
Benchmark benchmark) |
protected void |
parseParameters(java.lang.String[] args) |
abstract void |
prepare()
Prepares to run the test.
|
protected java.util.Map<java.lang.String,Benchmark.MethodStatistics> |
processMethodProfiles(long startMs,
long endMs,
java.util.function.Function<Benchmark.ProfileInput,java.lang.String> nameTransformer) |
java.lang.String |
run(java.lang.String[] args)
Runs the test and returns the string output.
|
abstract T |
runLocal()
Runs the test locally, in process.
|
protected java.lang.String |
runSingleTask(java.lang.String[] args) |
protected BaseParameters mBaseParameters
public abstract java.lang.String getBenchDescription()
public abstract T runLocal() throws java.lang.Exception
java.lang.Exceptionpublic abstract void prepare()
throws java.lang.Exception
java.lang.Exceptionpublic void cleanup()
throws java.lang.Exception
java.lang.Exceptionprotected static void mainInternal(java.lang.String[] args,
Benchmark benchmark)
public PlanConfig generateJobConfig(java.lang.String[] args)
StressBenchConfig as the default JobConfig.args - argumentspublic java.lang.String run(java.lang.String[] args)
throws java.lang.Exception
args - the command-line argsjava.lang.Exceptionprotected void parseParameters(java.lang.String[] args)
protected java.lang.String runSingleTask(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exceptionprotected java.util.Map<java.lang.String,Benchmark.MethodStatistics> processMethodProfiles(long startMs, long endMs, java.util.function.Function<Benchmark.ProfileInput,java.lang.String> nameTransformer) throws java.io.IOException
startMs - the start timeendMs - the end timenameTransformer - function which transforms the type and method into a name. If the
function returns null, then the method is skippedjava.io.IOExceptionCopyright © 2022. All Rights Reserved.