Interface Benchmark

All Superinterfaces:
BenchmarkResult
All Known Implementing Classes:
BenchmarkBuilder

public interface Benchmark extends BenchmarkResult
Implemented by executable benchmarks, a benchmark object is a single benchmark operation.
  • 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

      Benchmark setProperty(String key, Object value)
      Sets a property on the benchmark object, may be a parameter or a result.
      Parameters:
      key - the key to identify this property
      value - the value to insert
      Returns:
      fluent
    • getProperties

      Map<String,​Object> 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

      Benchmark setIterations(int iterations)
      Parameters:
      iterations - the number of iterations this benchmark will be executed for.
      Returns:
      fluent
    • setName

      void setName(String name)
      Parameters:
      name - the name of the benchmark to set.