logo AWS Technology Partner

API: Starting a Load Test

API Endpoint
https://www.redline13.com/Api/LoadTest

This API allows you to start any load test. Load test paramters are grouped into three categories

The result of a succesful API call is JSON document with one parameter

Example of executing load tests through an API via Curl are available at the end of this page.

API Parameters

Generic Parameters

Used for all test types.

Parameter Required Details
testType Yes

Use the following depending on test type.

  • simple
  • custom-test
  • jmeter-test
  • gatling-test
  • replay
name No

Optional test name.

desc No

Optional description of the test.

storeOutput No Should the output be stored? Tor F. If output is stored, we will also calculate percentiles.

Test Type Specific

Simple

Parameter Required Details
url Yes

The URL to test. Be sure to include http:// or https://.

numUsers Yes

Number of users to simulate in the test. This must equal the sum of the total users specified on a per server basis.

numIterations Yes

Number of iterations that each user will simulate.

rampUpSec No

Ramp up time in seconds.

minDelayMs Yes

Minimum delay in milliseconds before loading the URL for reach request.

maxDelayMs Yes

Maximum delay in milliseconds before loading the URL for reach request.

loadResources No

Should resources (images, CSS, and javascript) in the returned HTML be loaded? Tor F.

params No

This field is an array of GET, POST, BODY, or HEADER parameters that you want to include in the requests to the URL entered. Each row of the array includes

type get,post,body,header The parameter type
name string name of the header,post, or get parameter. (not used for body)
val string Value of the header, post, get, or body
mime string For type body, what is the parameter's mime type. For example: application/json

To post 2 parameters, you should use the following names for the parameters: params[0][type], params[0][name], params[0][val], params[1][type], params[1][name], params[1][val].

Custom

Parameter Required Details
file Yes

Raw file contents of custom test.

extras[] No

Raw file contents of extra files. In curl this would be -F extras[]=@/path/to/file. You can add multiple files.

numUsers Yes

Number of users to simulate in the test. This must equal the sum of the total users specified on a per server basis.

loadResources No

Should resources (images, CSS, and javascript) in the returned HTML be loaded? Tor F.

lang Yes

Programming language to use. php, python, ornodejs.

plugin No

Array of plugin names. plugin[0], plugin[1]

[plugin-name]_[KEY] No

Every plugin defines its own parameters and they can be passed through with plugin-name_key=value

JMeter

Parameter Required Details
file Yes

Raw file contents of JMeter test.

extras[] No

Raw file contents of extra files. In curl this would be -F extras[]=@/path/to/file. You can add multiple files.

numServers Yes

Number of servers to use in the test. This must equal the sum of the total servers specified on a per server basis.

version Yes

Accepted values are

  • 2.13
  • 3.1
  • 3.3
  • 4.0
  • 5.0
  • 5.2
  • 5.2.1
  • 5.3
  • nightly
opts No

Specify JMeter Options as -Jkey=value -Jkey=value

jvm_args No Specify JVM Options such as -Xms256m -Xmx256m
plugin No Array of plugin names. plugin[0], plugin[1]
[plugin-name]_[KEY] No Every plugin defines its own parameters and they can be passed through with plugin-name_key=value
webdriver-width No if webdriver plugin is enabled, Screen Width for simulated browser
webdriver-height No if webdriver plugin is enabled, Screen Height for simulated browser
webdriver-depth No if webdriver plugin is enabled, Screen Depth for simulated browser

Gatling

Parameter Required Details
file Yes

Raw file contents of Gatling Test.

extras[] No

Raw file contents of extra files. In curl this would be -F extras[]=@/path/to/file. You can add multiple files.

numServers Yes

Number of servers to use in the test. This must equal the sum of the total servers specified on a per server basis.

version Yes

Accepted values are

  • 2.1.6
  • 2.2.0
  • latest
opts No

Specify Options as -Dkey=value -Dkey=value

plugin No Array of plugin names. plugin[0], plugin[1]
[plugin-name]_[KEY] No Every plugin defines its own parameters and they can be passed through with plugin-name_key=value

LogFile Replay

Parameter Required Details
file Yes

Raw file contents of LOG file.

log_format No

The log file pattern, such as '%h %l %u %t "%r" %>s %b'

numUsers Yes

Number of users to simulate in the test. This must equal the sum of the total users specified on a per server basis.

url No

Specify Base URL for log file replay, http(s)://my.example.com/

numIterations Yes

Number of iterations that each user will simulate.

rampUpSec No

Ramp up time in seconds.

minDelayMs Yes

Minimum delay in milliseconds before loading the URL for reach request.

maxDelayMs Yes

Maximum delay in milliseconds before loading the URL for reach request.

loadResources No

Should resources (images, CSS, and javascript) in the returned HTML be loaded? Tor F.

Cloud

Parameter Required Details
keyPairId Yes

Key pair ID. This ID can be found here once you have a key setup.

servers Yes

This field is an array of server details. Each row of the array includes location, size, num, onDemand, maxPrice, usersPerServer, volumeSize, subnetId, associatePublicIpAddress, and securityGroupIds. To post 2 servers, you should use the following names for the parameters: servers[0][location], servers[0][size], …, servers[1][location], servers[1][size], ….

  • location- Server location (us-east-1, us-west-1, us-west-2, eu-west-1, eu-central-1, sa-east-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, ap-northeast-2, ap-south-1, us-east-2, ca-central-1, eu-west-2, eu-west-3, eu-north-1, ap-east-1, me-south-1, af-south-1, eu-south-1)
  • size- Server size. Please note that not all sizes are available in all locations. (t2.nano, t2.micro, t2.small, t2.medium, t2.large, t2.xlarge, t2.2xlarge, t3.nano, t3.micro, t3.small, t3.medium, t3.large, t3.xlarge, t3.2xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, m4.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m4.10xlarge, m4.16xlarge, m5.large, m5.xlarge, m5.2xlarge, m5.4xlarge, m5.12xlarge, m5.24xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, c5.large, c5.xlarge, c5.2xlarge, c5.4xlarge, c5.9xlarge, c5.18xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, r4.large, r4.xlarge, r4.2xlarge, r4.4xlarge, r4.8xlarge, r4.16xlarge, r5.large, r5.xlarge, r5.2xlarge, r5.4xlarge, r5.12xlarge, r5.24xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, x1.16xlarge, x1.32xlarge)
  • num- Number of servers to start in this location and size.
  • onDemand- Use on-demand instances? Tor F. Findicates that a spot instance should be used.
  • maxPrice- If using spot instances, the maximum spot price bid.
  • usersPerServer- Number of users per server, only relevant for Custom and Simple when not even separation.
  • volumeSize- Optional disk size.
  • subnetId- Optional subnet ID.
  • associatePublicIpAddress- If using a subnet, should we request that AWS assign a public IP address to the instances? Tor F
  • securityGroupIds- Optional security group IDs separated by commas.

Not that you can only post one row for each location/size pair.

Examples

Executing A JMeter Test

curl https://www.redline13.com/Api/LoadTest \
  -H "X-Redline-Auth: YOUR_API_KEY" \
  -F testType=jmeter-test \
  -F name=JMeterFromAPI \
  -F "file=@/Downloads/MyJmeterTest.jmx" \
  -F numServers=1 \
  -F storeOutput=T \
  -F servers[0][location]=us-east-1 \
  -F servers[0][size]=m3.medium \
  -F servers[0][num]=1 \
  -F servers[0][onDemand]=T \
  -F servers[0][usersPerServer]=1 \
  -F keyPairId=YOUR_KEY_PAIR_ID

Executing A LogFile Replay Test

curl https://www.redline13.com/Api/LoadTest \
  -H "X-Redline-Auth: YOUR_API_KEY" \
  -F testType=replay \
  -F name=LoadTestFromAPI \
  -F numServers=1 \
  -F storeOutput=T \
  -F servers[0][location]=us-east-1 \
  -F servers[0][size]=m3.medium \
  -F servers[0][num]=1 \
  -F servers[0][onDemand]=T \
  -F servers[0][usersPerServer]=1 \
  -F keyPairId=YOUR_KEY_PAIR_ID_OR_DO_NOT_INCLUDE_FOR_DEFAULT  \
  -F numUsers=1  \
  -F url=https://www.yahoo.com/ \
  -F log_format='%h %l %u %t "%r" %>s %b' \
  -F minDelayMs=500  \
  -F maxDelayMs=1000 \
  -F numIterations=5 \
  -F "file=@/PATH_TO_YOUR_LOGFILE/some_log_file.log"