Class BenchmarkImplementationBuilder
java.lang.Object
com.codingchili.core.benchmarking.BenchmarkImplementationBuilder
- All Implemented Interfaces:
BenchmarkImplementation
- Direct Known Subclasses:
MapBenchmarkImplementation
"Abstract" benchmark-implementation.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(String name, BenchmarkOperation operation)Adds a new benchmark created from an operation and name.getName()Name of the implementation that is used within a benchmark.get all properties added to the implementation.voidinitialize(CoreContext core, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> future)Prepares an implementation for testing.voidCalled before each benchmark is executed.voidCalled after the warmup phase has completed.setBenchmarks(List<Benchmark> benchmarks)Sets the benchmarks to a list of benchmarks, may be used when creating reports.setGroup(BenchmarkGroup group)May be used in the reporting phase to restructure results.setProperty(String key, Object value)Set a property of the benchmark implementation.voidCalled after the benchmarking has completed.
-
Field Details
-
group
-
-
Constructor Details
-
BenchmarkImplementationBuilder
-
-
Method Details
-
setGroup
- Specified by:
setGroupin interfaceBenchmarkImplementation- Parameters:
group- the group the implementation is part of.- Returns:
- fluent
-
add
Description copied from interface:BenchmarkImplementationAdds a new benchmark created from an operation and name.- Specified by:
addin interfaceBenchmarkImplementation- Parameters:
name- the name of the operation/benchmark.operation- the operation to execute as a benchmark.- Returns:
- fluent
-
initialize
public void initialize(CoreContext core, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> future)Description copied from interface:BenchmarkImplementationPrepares an implementation for testing.- Specified by:
initializein interfaceBenchmarkImplementation- Parameters:
core- the context to use for the benchmarkfuture- called when the setup is complete.
-
next
Description copied from interface:BenchmarkImplementationCalled before each benchmark is executed.- Specified by:
nextin interfaceBenchmarkImplementation- Parameters:
promise- callback
-
reset
Description copied from interface:BenchmarkImplementationCalled after the warmup phase has completed.- Specified by:
resetin interfaceBenchmarkImplementation- Parameters:
future- callback
-
shutdown
Description copied from interface:BenchmarkImplementationCalled after the benchmarking has completed.- Specified by:
shutdownin interfaceBenchmarkImplementation- Parameters:
promise- callback
-
getBenchmarks
- Specified by:
getBenchmarksin interfaceBenchmarkImplementation- Returns:
- a listof benchmarks that should be executed for the given implementation.
-
setBenchmarks
Description copied from interface:BenchmarkImplementationSets the benchmarks to a list of benchmarks, may be used when creating reports.- Specified by:
setBenchmarksin interfaceBenchmarkImplementation- Parameters:
benchmarks- the benchmarks to set- Returns:
- fluent
-
getName
Description copied from interface:BenchmarkImplementationName of the implementation that is used within a benchmark. A good choice isClass.getSimpleName().- Specified by:
getNamein interfaceBenchmarkImplementation- Returns:
- a string that identifies the implementation tested.
-
setName
Description copied from interface:BenchmarkImplementationMay be used in the reporting phase to restructure results.- Specified by:
setNamein interfaceBenchmarkImplementation- Parameters:
name- the name of the implementation- Returns:
- fluent.
-
setProperty
Description copied from interface:BenchmarkImplementationSet a property of the benchmark implementation.- Specified by:
setPropertyin interfaceBenchmarkImplementation- Parameters:
key- the key to identify the value.value- the value to be inserted.- Returns:
- fluent
-
getProperties
Description copied from interface:BenchmarkImplementationget all properties added to the implementation.- Specified by:
getPropertiesin interfaceBenchmarkImplementation- Returns:
- a map of all the properties that has been set.
-