Artillery.io TCP Plugin
Load test TCP with Artillery.io
Based on the AWS Lambda Engine by orchestrated.io.
Usage
Important: The plugin requires Artillery 1.5.8-3
or higher.
Install the plugin
# If Artillery is installed globally:
npm install -g artillery-engine-tcp
Use the plugin
- Set
config.target
to the host address of the TCP server - Specify additional options in
config.tcp
:port
- number (required)
- Set the
engine
property of the scenario totcp
. - Use
send
in your scenario to send arbitrary data to the server - Specify additional invocation parameters:
payload
- String or object (gets converted to JSON string) with the payload to sendencoding
- Payload string encoding. Defaults toutf8
. See Buffer.from(string).
Note: The TCP server must respond (with anything) to each send
command in order for the request to finish.
Example Script
config: target: "localhost" tcp: port: 1234 phases: - arrivalCount: 10 duration: 1 engines: tcp: {} scenarios: - name: "Send data" engine: tcp flow: - count: 10 loop: - send: payload: "hello world" - think: 1 - send: payload: "1111111111" encoding: "hex" - think: 1
Run Your Script
artillery run my_script.yml