Class IterationContext

java.lang.Object
org.mockserver.load.IterationContext

public class IterationContext extends Object
Per-iteration template variable exposed to a LoadScenario step under the key "iteration", sibling of request / response. It lets a step's templated request fields vary per iteration without any cross-step state (e.g. $iteration.index for a unique path segment).

Plain JavaBean getters so all three engine syntaxes resolve identically: $iteration.index (Velocity), {{iteration.index}} (Mustache) and iteration.getIndex() (JavaScript).

  • getIndex() — global iteration index across all virtual users (0-based)
  • getVuId() — the launching virtual user's id (0-based)
  • getVuIteration() — the iteration count within that virtual user (0-based)
  • getElapsedMillis() — millis since the scenario started
  • getCount() — total requests dispatched so far (the global request counter)
  • Constructor Details

    • IterationContext

      public IterationContext(long index, int vuId, long vuIteration, long elapsedMillis, long count)
  • Method Details

    • getIndex

      public long getIndex()
    • getVuId

      public int getVuId()
    • getVuIteration

      public long getVuIteration()
    • getElapsedMillis

      public long getElapsedMillis()
    • getCount

      public long getCount()