Interface Benchmark
- All Superinterfaces:
BenchmarkResult
- All Known Implementing Classes:
BenchmarkBuilder
Implemented by executable benchmarks, a benchmark object is a single benchmark operation.
-
Field Summary
Fields inherited from interface com.codingchili.core.benchmarking.BenchmarkResult
DATE_FORMAT, EPOCH_BASE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
finish()
Finish benchmarking: calculates the results.long
getName()
The handler of the single benchmark operation to run.The operation to benchmark.get all properties added to the implementation.boolean
setIterations(int iterations)
void
setProperty(String key, Object value)
Sets a property on the benchmark object, may be a parameter or a result.start()
Start measuring of the execution time.Methods inherited from interface com.codingchili.core.benchmarking.BenchmarkResult
getRate, getRateFormatted, getTimeFormatted
-
Method Details
-
getOperation
BenchmarkOperation getOperation()The operation to benchmark.- Returns:
- an executable benchmark.
-
getName
String getName()The handler of the single benchmark operation to run. Should typically match the method handler.- Returns:
- a string that identifies the handler the Benchmark operation.
-
setProperty
Sets a property on the benchmark object, may be a parameter or a result.- Parameters:
key
- the key to identify this propertyvalue
- the value to insert- Returns:
- fluent
-
getProperties
get all properties added to the implementation.- Returns:
- a map of all the properties that has been set.
-
start
Benchmark start()Start measuring of the execution time.- Returns:
- fluent
-
finish
void finish()Finish benchmarking: calculates the results. -
getElapsedMS
long getElapsedMS()- Returns:
- the time taken to complete the benchmark in ms.
-
isFinished
boolean isFinished()- Returns:
- returns true if
finish()
has been called.
-
setIterations
- Parameters:
iterations
- the number of iterations this benchmark will be executed for.- Returns:
- fluent
-
setName
- Parameters:
name
- the name of the benchmark to set.
-