RedLine13 load generator instances are backed by AWS EC2 instances. AWS exposes a special locally-addressable endpoint that returns metadata about that instance. Using this, you can ascertain such things as the region in which your instance resides, private and public addresses, and instance tags amongst other useful data points.
A specific example of where this would be useful is where you have defined a load test to run in multiple regions, with a number of EC2-backed load generator servers in each. You can call the metadata endpoint from your load test and determine specific actions to take.
One customer recently had this exact use case. They were running a single load test across multiple AWS regions, with each region using a different dataset from separate CSV file data sources. The placement/region
call makes it possible to extract the region and subnet location in one easy call:
http://169.254.169.254/latest/meta-data/placement/availability-zone
The result of the above request when run on the EC2 instance returns a plain-text string containing the AWS region and subnet:
us-east-1f
When incorporated into your test plan (e.g., using a JSR223 Preprocessor within JMeter) your script can logically select between CSV files or other test actions which are specific to the region in which the test is running.
Did you know that RedLine13 offers a limited time full-featured free trial? Sign up now and start testing today!