Class IterationParams

java.lang.Object
org.openjdk.jmh.infra.IterationParams
All Implemented Interfaces:
Serializable

public final class IterationParams extends Object
Iteration parameters.

Iteration parameters are separated in at least two instances, with different IterationType-s. The complete benchmark parameters not specific for a particular iteration are available in BenchmarkParams.

This class is dual-purpose:

  1. It acts as the interface between host JVM and forked JVM, so that the latter would not have to figure out the benchmark configuration again
  2. It can be injected into benchmark methods to access the runtime configuration info about the benchmark
See Also:
  • Field Details

    • type

      protected final IterationType type
      iteration type
    • count

      protected final int count
      amount of iterations
    • timeValue

      protected final TimeValue timeValue
      iteration runtime
    • batchSize

      protected final int batchSize
      batch size (method invocations inside the single op)
  • Constructor Details

  • Method Details

    • getType

      public IterationType getType()
      Iteration type: separates warmup iterations vs. measurement iterations.
      Returns:
      iteration type.
    • getCount

      public int getCount()
      Number of iterations.
      Returns:
      number of iterations of given type.
    • getTime

      public TimeValue getTime()
      Time for iteration.
      Returns:
      time
    • getBatchSize

      public int getBatchSize()
      Batch size for iteration.
      Returns:
      batch size
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object