Skip to content
Shane Barbetta edited this page Jul 25, 2018 · 11 revisions

Methods for creating and administering load tests.

Method summary:

echo()

  Echo a message back to the user

who_am_i()

  Returns the username associated with the API credentials

list_most_recent_jsonp()

  Retrieve a list of recent tests with a JSONP callback

list()

  Retrieve a list of recent tests

add_tag()

  Add a name tag to a test

remove_tag()

  Remove a tag from a test

get()

  Retrieve a test

delete()

  Delete a test

pause()

  Pause a running test

resume()

  Resume a paused test

schedule()

  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"}])

Clone this wiki locally