Class BenchmarkImplementationBuilder
java.lang.Object
com.codingchili.core.benchmarking.BenchmarkImplementationBuilder
- All Implemented Interfaces:
BenchmarkImplementation
- Direct Known Subclasses:
MapBenchmarkImplementation
"Abstract" benchmark-implementation.
-
Field Summary
-
Constructor Summary
-
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.void
initialize(CoreContext core, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> future)
Prepares an implementation for testing.void
Called before each benchmark is executed.void
Called 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.void
Called after the benchmarking has completed.
-
Field Details
-
group
-
-
Constructor Details
-
BenchmarkImplementationBuilder
-
-
Method Details
-
setGroup
- Specified by:
setGroup
in interfaceBenchmarkImplementation
- Parameters:
group
- the group the implementation is part of.- Returns:
- fluent
-
add
Description copied from interface:BenchmarkImplementation
Adds a new benchmark created from an operation and name.- Specified by:
add
in 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:BenchmarkImplementation
Prepares an implementation for testing.- Specified by:
initialize
in interfaceBenchmarkImplementation
- Parameters:
core
- the context to use for the benchmarkfuture
- called when the setup is complete.
-
next
Description copied from interface:BenchmarkImplementation
Called before each benchmark is executed.- Specified by:
next
in interfaceBenchmarkImplementation
- Parameters:
promise
- callback
-
reset
Description copied from interface:BenchmarkImplementation
Called after the warmup phase has completed.- Specified by:
reset
in interfaceBenchmarkImplementation
- Parameters:
future
- callback
-
shutdown
Description copied from interface:BenchmarkImplementation
Called after the benchmarking has completed.- Specified by:
shutdown
in interfaceBenchmarkImplementation
- Parameters:
promise
- callback
-
getBenchmarks
- Specified by:
getBenchmarks
in interfaceBenchmarkImplementation
- Returns:
- a listof benchmarks that should be executed for the given implementation.
-
setBenchmarks
Description copied from interface:BenchmarkImplementation
Sets the benchmarks to a list of benchmarks, may be used when creating reports.- Specified by:
setBenchmarks
in interfaceBenchmarkImplementation
- Parameters:
benchmarks
- the benchmarks to set- Returns:
- fluent
-
getName
Description copied from interface:BenchmarkImplementation
Name of the implementation that is used within a benchmark. A good choice isClass.getSimpleName()
.- Specified by:
getName
in interfaceBenchmarkImplementation
- Returns:
- a string that identifies the implementation tested.
-
setName
Description copied from interface:BenchmarkImplementation
May be used in the reporting phase to restructure results.- Specified by:
setName
in interfaceBenchmarkImplementation
- Parameters:
name
- the name of the implementation- Returns:
- fluent.
-
setProperty
Description copied from interface:BenchmarkImplementation
Set a property of the benchmark implementation.- Specified by:
setProperty
in interfaceBenchmarkImplementation
- Parameters:
key
- the key to identify the value.value
- the value to be inserted.- Returns:
- fluent
-
getProperties
Description copied from interface:BenchmarkImplementation
get all properties added to the implementation.- Specified by:
getProperties
in interfaceBenchmarkImplementation
- Returns:
- a map of all the properties that has been set.
-