By default, Loads is built in a way which makes it possible to have tests runners written in any languages. To do that, it uses ZeroMQ to do communicate.
This document describes the protocol you need to implement if you want to create your own runner.
Currently, there is only a Python implementation and a JavaScript implementation (using the Mocha test framework for the latter). The JS runner is provided in a separate project named loads.js.
If you have implemented your own runner, feel free to submit us a patch or a pull request.
Each message sent to Loads needs to respect the following rules:
A message generally looks like this:
{
data_type: 'something',
agent_id: '1',
run_id: '1234',
other_key_1: 'foo'
other_key_2: 'bar'
}
Some messages take a loads_status argument. loads_status is a list of values concerning the current status of the load.
With loads, you can run cycle of runs. For instance, if you pass 10:50:100 for the users, it will start with 10 users in parallel, and then 50 and finally 100.
Loads status contains information about the current number of users we have to run for the cycle we are in (50, for instance), and the user we are currently taking care of (could be 12). Same applies for the hits.
It contains, in this order:
When errors / exceptions are caught, they are serialised and sent trough the wire, as well. When you see an exc *, it is a list containing this:
When using Loads, you usually run a test suite. Tests start, stop, succeed and fail. Here are the APIs you can use:
You should not send the startTestRun and stopTestRun messages.
To track requests, you only have one method, named “add_hit” with the following parameters:
If you’re also able to track what’s going on with the socket connections, then you can use the following messages: