Class IterationContext
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 startedgetCount()— total requests dispatched so far (the global request counter)getCaptured()— cross-step captured variables for this iteration (seeLoadCapture)getData()— the data-feeder row selected for this iteration (seeLoadFeeder)
getCaptured() exposes the iteration's mutable captured-variable map so a step's
templated request fields can reference values extracted from an earlier step's response, e.g.
$iteration.captured.token (Velocity) / {{iteration.captured.token}} (Mustache).
Both engines resolve a member of a Map<String,String> getter by key. Scope is per-iteration
(one virtual user's single pass through the steps); the map is never shared across users/iterations.
getData() exposes the single data-feeder row selected for this iteration the same way,
referenced as $iteration.data.<column> / {{iteration.data.<column>}}. Empty when the
scenario has no feeder.
-
Constructor Summary
ConstructorsConstructorDescriptionIterationContext(long index, int vuId, long vuIteration, long elapsedMillis, long count) IterationContext(long index, int vuId, long vuIteration, long elapsedMillis, long count, Map<String, String> captured) IterationContext(long index, int vuId, long vuIteration, long elapsedMillis, long count, Map<String, String> captured, Map<String, String> data) -
Method Summary
Modifier and TypeMethodDescriptionThe iteration's cross-step captured variables (name to extracted value), referenced from a step's templated fields as$iteration.captured.<name>/{{iteration.captured.<name>}}.longgetCount()getData()The data-feeder row selected for this iteration (column to value), referenced from a step's templated fields as$iteration.data.<column>/{{iteration.data.<column>}}.longlonggetIndex()intgetVuId()long
-
Constructor Details
-
IterationContext
public IterationContext(long index, int vuId, long vuIteration, long elapsedMillis, long count) -
IterationContext
-
IterationContext
-
-
Method Details
-
getIndex
public long getIndex() -
getVuId
public int getVuId() -
getVuIteration
public long getVuIteration() -
getElapsedMillis
public long getElapsedMillis() -
getCount
public long getCount() -
getCaptured
The iteration's cross-step captured variables (name to extracted value), referenced from a step's templated fields as$iteration.captured.<name>/{{iteration.captured.<name>}}. Never null (empty when nothing has been captured yet). -
getData
The data-feeder row selected for this iteration (column to value), referenced from a step's templated fields as$iteration.data.<column>/{{iteration.data.<column>}}. Never null (empty when the scenario has no feeder). The map is unmodifiable.
-