Interface BenchmarkImplementation
- All Known Implementing Classes:
BenchmarkImplementationBuilder
,MapBenchmarkImplementation
public interface BenchmarkImplementation
Groups benchmarks of the same implementation together.
-
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.
-
Method Details
-
initialize
Prepares an implementation for testing.- Parameters:
core
- the context to use for the benchmarkfuture
- called when the setup is complete.
-
next
Called before each benchmark is executed.- Parameters:
future
- callback
-
reset
Called after the warmup phase has completed.- Parameters:
future
- callback
-
shutdown
Called after the benchmarking has completed.- Parameters:
future
- callback
-
add
Adds a new benchmark created from an operation and name.- Parameters:
name
- the name of the operation/benchmark.operation
- the operation to execute as a benchmark.- Returns:
- fluent
-
getBenchmarks
- Returns:
- a listof benchmarks that should be executed for the given implementation.
-
setBenchmarks
Sets the benchmarks to a list of benchmarks, may be used when creating reports.- Parameters:
benchmarks
- the benchmarks to set- Returns:
- fluent
-
getName
String getName()Name of the implementation that is used within a benchmark. A good choice isClass.getSimpleName()
.- Returns:
- a string that identifies the implementation tested.
-
setName
May be used in the reporting phase to restructure results.- Parameters:
name
- the name of the implementation- Returns:
- fluent.
-
setProperty
Set a property of the benchmark implementation.- Parameters:
key
- the key to identify the value.value
- the value to be inserted.- Returns:
- fluent
-
getProperties
get all properties added to the implementation.- Returns:
- a map of all the properties that has been set.
-
setGroup
- Parameters:
group
- the group the implementation is part of.- Returns:
- fluent
-