Socket.IO v3 engine for Artillery
In addition to upgrading the Socket.IO lib to version 3 this engine also modifies the original YML API documented at artillery.io.
The emit
action no longer supports all the other explicit options like channel
and data
. Instead, it will accept
a list or array of arguments that will be passed to the Socket.IO emit
function. Ex:
scenarios:
- engine: socketio-v3
flow:
- emit: ["join", "lobby"]
# Also can be written as
- emit:
- join
- lobby
All other advance options like namespace
and acknowledge
can still be included alongside the emit
action but not
under it. Ex:
scenarios:
- engine: socketio-v3
flow:
- emit: ["join", "lobby"]
namespace: /nsp1
Install with npm
npm install -D artillery-engine-socketio-v3
Enable the socketio-v3
engine by listing it in config.engines
. Ex:
config:
target: "http://localhost:3000"
phases:
- duration: 30
arrivalRate: 5
engines:
socketio-v3: {}
In each scenario you must list the engine socketio-v3
as well. Ex:
scenarios:
- name: My first scenario
engine: socketio-v3
flow:
- emit: ["join", "lobby"]
- emit: ["message", "lobby", "Hello World"]