JMeter tests running on RedLine13 with multiple load generators have visibility to the server “index” number as a JMeter property. One of our customers was running large scale load tests across multiple servers. They needed a way to correlate test plans running on individual server machines, something akin to the example described below. Sometimes useful features come from our customers solving real-world issues, and this is an example of one such case.
This property – rl13_agentindex – joins two other similar properties (rl13_serverid and rl13_testid) that RedLine13 exposes. Here is a summary of these properties for reference:
- rl13_agentindex:
- Zero-based index of load generator (e.g., “0”, “1”, etc.)
- rl13_serverid:
- AWS-assigned unique identifier for a load generator instance
- rl13_testid:
- The test ID number that is assigned by RedLine13
In order to take advantage of these properties, you may use JMeter property variable notation in your request handlers or within your scripts. The preferred shorthand for this notation is via use of the __P() function covered here in JMeter’s documentation and used as follows:
${__P(property_name,default_value)} or, if no default value is needed: ${__P(property_name)}
If for instance we wanted to access the rl13_agentindex property, we could include the expression ${__P(rl13_agentindex)} in an HTTP request sampler or any BeanShell Post-processor script.
One useful case might be to match a specific load generator to a specific request. In the following example we are passing rl13_agentindex to an API call to be correlated with application logs:
In our JMeter output we find this translates to the following request:
https://api.webservice.com/v1/widget?item_code=101&request_origin=3
From there we can find “request_origin=3” in our application logs, and also compare to output files generated for load agent server “3”:
This can be immensely useful for both troubleshooting a test plan in development, as well as root cause analysis of a problem uncovered as a result of a performance test.
Did you know that RedLine13 offers a full-featured free trial? Sign up now and follow these steps in your first cloud test with us today.