Class BenchmarkGroupBuilder

java.lang.Object
com.codingchili.core.benchmarking.BenchmarkGroupBuilder
All Implemented Interfaces:
BenchmarkGroup

public class BenchmarkGroupBuilder extends Object implements BenchmarkGroup
"Abstract" implementation of a map group.
  • Constructor Details

    • BenchmarkGroupBuilder

      public BenchmarkGroupBuilder(String name, int iterations)
      Parameters:
      name - the name of the group.
      iterations - number of iterations to perform for each benchmark.
  • Method Details

    • getName

      public String getName()
      Description copied from interface: BenchmarkGroup
      The handler of the benchmark group, for example "networking" or "storage". Benchmarks are grouped under this in the reports.
      Specified by:
      getName in interface BenchmarkGroup
      Returns:
      a string that identifies a group of benchmarks.
    • getIterations

      public int getIterations()
      Description copied from interface: BenchmarkGroup
      Number of iterations that the benchmark operation is to be executed.
      Specified by:
      getIterations in interface BenchmarkGroup
      Returns:
      a integer indicating the number of operation iterations.
    • getImplementations

      public Collection<BenchmarkImplementation> getImplementations()
      Description copied from interface: BenchmarkGroup
      Get the implementations enlisted for benchmarking in this group.
      Specified by:
      getImplementations in interface BenchmarkGroup
      Returns:
      a list of implementations to benchmark.
    • setImplementations

      public BenchmarkGroup setImplementations(Map<String,​BenchmarkImplementation> implementations)
      Description copied from interface: BenchmarkGroup
      Sets the implementations in the group to the given list. May be used when creating reports.
      Specified by:
      setImplementations in interface BenchmarkGroup
      Parameters:
      implementations - the implementations to set.
      Returns:
      fluent
    • implementation

      public BenchmarkImplementation implementation(String implementationName)
      Description copied from interface: BenchmarkGroup
      Adds a new implementation to the benchmark group.
      Specified by:
      implementation in interface BenchmarkGroup
      Parameters:
      implementationName - the name of the implementation to add.
      Returns:
      an implementation
    • getProgressInterval

      public int getProgressInterval()
      Description copied from interface: BenchmarkGroup
      Return the number of iterations to complete before calling a listeners progress listener.
      Specified by:
      getProgressInterval in interface BenchmarkGroup
      Returns:
      the number of iterations.
    • add

      public void add(BenchmarkImplementation implementation)
      Specified by:
      add in interface BenchmarkGroup
      Parameters:
      implementation - the benchmark implementation to add.