Package alluxio.stress.cli
Class Benchmark<T extends alluxio.stress.TaskResult>
- java.lang.Object
-
- alluxio.stress.cli.Benchmark<T>
-
- Type Parameters:
T- the type of task result
- Direct Known Subclasses:
AbstractMaxThroughput,AbstractStressBench,CompactionBench,FuseIOBench,RpcBench,StressJobServiceBench,UfsIOBench
public abstract class Benchmark<T extends alluxio.stress.TaskResult> extends java.lang.ObjectBase class for all stress benchmarks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classBenchmark.MethodStatisticsprotected static classBenchmark.ProfileInput
-
Field Summary
Fields Modifier and Type Field Description protected alluxio.stress.BaseParametersmBaseParameters
-
Constructor Summary
Constructors Constructor Description Benchmark()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcleanup()Perform post-run cleanups.alluxio.job.plan.PlanConfiggenerateJobConfig(java.lang.String[] args)Generate aStressBenchConfigas the default JobConfig.abstract java.lang.StringgetBenchDescription()Get the description of the bench.protected static voidmainInternal(java.lang.String[] args, Benchmark benchmark)protected voidparseParameters(java.lang.String[] args)abstract voidprepare()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.Stringrun(java.lang.String[] args)Runs the test and returns the string output.abstract TrunLocal()Runs the test locally, in process.protected java.lang.StringrunSingleTask(java.lang.String[] args)
-
-
-
Method Detail
-
getBenchDescription
public abstract java.lang.String getBenchDescription()
Get the description of the bench.- Returns:
- string of the bench description
-
runLocal
public abstract T runLocal() throws java.lang.Exception
Runs the test locally, in process.- Returns:
- the task result
- Throws:
java.lang.Exception
-
prepare
public abstract void prepare() throws java.lang.ExceptionPrepares to run the test.- Throws:
java.lang.Exception
-
cleanup
public void cleanup() throws java.lang.ExceptionPerform post-run cleanups.- Throws:
java.lang.Exception
-
mainInternal
protected static void mainInternal(java.lang.String[] args, Benchmark benchmark)
-
generateJobConfig
public alluxio.job.plan.PlanConfig generateJobConfig(java.lang.String[] args)
Generate aStressBenchConfigas the default JobConfig.- Parameters:
args- arguments- Returns:
- the JobConfig
-
run
public java.lang.String run(java.lang.String[] args) throws java.lang.ExceptionRuns the test and returns the string output.- Parameters:
args- the command-line args- Returns:
- the string result output
- Throws:
java.lang.Exception
-
parseParameters
protected void parseParameters(java.lang.String[] args)
-
runSingleTask
protected java.lang.String runSingleTask(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
processMethodProfiles
protected 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
- Parameters:
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 skipped- Returns:
- a map of names to statistics
- Throws:
java.io.IOException
-
-