-
Notifications
You must be signed in to change notification settings - Fork 3
Load Test API
Methods for creating and administering load tests.
Method summary:
Echo a message back to the user
Returns the username associated with the API credentials
Retrieve a list of recent tests with a JSONP callback
Retrieve a list of recent tests
Add a name tag to a test
Remove a tag from a test
Retrieve a test
Delete a test
Pause a running test
Resume a paused test
Schedule a test
echo(string msg)
Echo a message back to the user
Arguments:
msg - A message to echo
Example:
c.load().echo('Hello world')who_am_i()
Returns the username associated with the API credentials
Example:
c.load().who_am_i()list_most_recent_jsonp(int limit, string callback)
Retrieve a list of recent tests with a JSONP callback
Arguments:
limit - Maximum number of tests to retrieve
callback - A javascript function to be called when the JSONP result is received
Example:
c.load().list_most_recent_jsonp(10, 'function jsonCallback(){}')list(int limit)
Retrieve a list of recent tests
Arguments:
limit - Maximum number of tests to retrieve
Example:
c.load().list(10)add_tag(string tag_name)
Add a name tag to a test
Arguments:
tag_name - The name tag to be added
Example:
python c.load('test_id').add_tag('my_tag')
remove_tag(string tag_name)
Remove a tag from a test
Arguments:
tag_name - The name tag to be removed
Example:
python c.load('test_id').remove_tag('my_tag')
get()
Retrieve a test
Example:
python c.load('test_id').get()
delete()
Delete a test
Example:
python c.load('test_id').delete()
pause()
Pause a test
Example:
python c.load('test_id').pause()
resume()
Resume a paused test
Example:
python c.load('test_id').resume()
schedule(string name, string region, string start, array scripts, object parts, string override)
Schedule a test
Arguments:
name - The name of the test
region - The geographic region where the load will be generated from
US_WEST
US_EAST
EU_WEST
AP_SOUTHEAST
AP_NORTHEAST
SA_EAST
start - The date and time to begin the test in ISO 8601 format
scripts - An array of script objects to be executed in the test
{
"percentage": "int",
"scriptId": "string"
}parts - The load test plan (represents users over time) as an array of objects
{
"duration": "int",
"maxUsers": "int",
"type": "string"
}(optional) override - An override code that alters test behavior
Example:
c.load().schedule('my test', 'US_EAST', '2018-06-28T15:25:07+00:00', [{"percentage": 50, "scriptId": "myscript1"}, {"percentage": 50, "scriptId": "myscript2"}], [{"duration": 15, "maxUsers": 25, "type": "RAMP"}, {"duration": 15, "maxUsers": 50, "type": "CONSTANT"}])