Skip to content

Counter Variable Configuration

Counter Variable

The Counter Variable is used to generate numeric counters. It is set to Start value at initialization, incremented by Increment on each new iteration until it reaches End. The value is shared between all virtual users running on the same load generator by default.

The following procedure explains how to change a Counter variable configuration:

  1. Click on the variable to update in the variables list,
  2. Edit the input fields on the right,
  3. Close the variable panel by clicking on the Close button positioned at the right left corner.

For each Counter Variable, you can edit:

Property name Description
Name The variable name. To inject it, use the ${...} syntax.
Description The variable description
Start Value The Counter Variable starting value.
End Value The Counter Variable ending value.
Increment Value The Counter Variable increment, applied on each iteration.
Output Format The output format of the generated value. Leave blank for a simple number output. It uses the java.text.DecimalFormat. For example 000 generates numbers with at least 3 digits, and USER_000 generates output of the form USER_nnn.
Track counter The Counter Variable can be local to each user if this is activated, making it an iteration counter for each VU.
Reset counter The Counter Variable can be reset at each user iteration. This will effectively reset the counter to Start value every iteration, which can be useful if you edit it through scripts during the iteration. Otherwise be careful, the counter will always contain Start.