socket.io loadtesting examples
npm install socket.io-loadtestingtarget:- Used For Setting the Socket Address (ws/wss) Type !!
Ensure:- Goes with to otpn max (fail if max response time exceeds 500ms) and maxErrorRate (fail if error rate exceeds 1%) !!
transports:- Here We Set Protocol So Be Set ["websocket"] For testing Socket !!
processor:- Here We Mention the File Name Where we Want tho load dynamic scenario !!
phases:- in this Optn We Have duration (time test Run's in Milliseconds), arrivalRate (onStart the User we Have), rampTo (Will ramp Up User gradually), name (Name For That Phase) !!
scenarios:- Here We Define The Flow For Test case !!
engine:- we Set engine To 'socketio' !!
flow:- Here we Set Whole Test Flow
function (load function from custom.js Which get's Dummy Data)
emit (Inside this we have Channel (Socket Channel) and Data (data to send in that event(channel)) otpn)
think (do nothing for 5 seconds, then disconnect) !!