Skip to content

Runtime Properties

The Runtime Properties menu from the left panel lets you update JMeter Properties while the test is running:

Runtime Properties

These properties are initially defined in the JMeter tab of the User Profiles.

Saving Runtime Properties

The following procedure explains how to update JMeter Runtime Properties:

  1. Select a User Profile in the left table,
  2. Update the properties in the center panel,
  3. Click on the Save button.

Applying Runtime Properties to all User Profiles

The following procedure explains how to update Apply JMeter Runtime Properties to all User Profiles of the currently executed Scenario:

  1. Select a User Profile in the left table,
  2. Click on the Apply All button.

Controlling hit rate

Combining a runtime property with the hit rate config allows you to edit the hit rate while the test is running.

Hit rate change

First you need to use a config like this one on every runtime profile ${__P(hit)}:

Hit rate config

Then on the same runtime profile create a runtime property with the same name hit:

Runtime hit

Then editing this property while the test is running will allow you to change the hit rate:

Hit rate change

This can be particularly convenient to pause the execution temporarily and resume it later.

Share a value between all scripts

Remote control of properties also allows you to update a value shared among all users. Using this mechanism it is possible to have one script that will update a property used by all others. The script will use our API to get all properties and edit one of them with a particular value at regular intervals. To make this process easier you can download the script skeleton here.

The finality of this is to run the following script to create a JSON payload that will update a property on all load generators:

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.HashMap;
import java.util.Map;
Map myMap = new HashMap();
ObjectMapper objectMapper = new ObjectMapper();
myMap = objectMapper.readValue(vars.get("payload"), HashMap.class);
for (Map.Entry entry : myMap.entrySet())
{
  Map subMap = entry.getValue().get("map");
  subMap.put(vars.get("propName"),vars.get("propValue"));
}
String output = new ObjectMapper().writeValueAsString(myMap);
vars.put("payload", output);

Here's what you need to configure:

  1. Change the value of the variable propName to the name of your property as defined on the runtime screen: propName Runtime property

  2. There's a container named "Insert your script that populates propValue in here" this is where you can run your actions if any. The value you want to push must be put in a variable named propValue. For example you could put a request in there and combine it with a regex (named propValue as well) to extract a dynamic value. You can use another static variable instead, like a CSV variable, just name the relevant column of your CSV propValue and on each iteration of the script it will be assigned a new line in the file and push it to the right property.

  3. Configure the delay to pause for a certain time before the script runs again and updates the property again: Delay

This works even if you have other properties, they will be untouched.