shopee-colyseus-loadtest

0.14.3 • Public • Published

@colyseus/loadtest

Utility tool for load testing Colyseus.

Demo

asciicast

Usage

Install the tool globally in your system.

npm install -g @colyseus/loadtest
$ shopee-colyseus-loadtest --help

Options:
    --endpoint: WebSocket endpoint for all connections (default: ws://localhost:2567)
    --room: room handler name
    --numClients: number of connections to open

Example:
    shopee-colyseus-loadtest example/bot.ts --endpoint ws://localhost:2567 --room state_handler

Scripting

You may use either JavaScript or TypeScript for scripting your connections:

See below the methods that are called automatically, if implemented. (They are all optional.)

requestJoinOptions (i)

Should return a plain object containing the options for client connection i to join the room provided as an argument.

onJoin ()

Triggered when the client successfully joins in the room.

onMessage (message)

Triggered when the server sends a message to this client, or broadcasts to everyone.

onStateChange (state)

Triggered when the room state changes in the server-side.

onLeave ()

Triggered when the client leaves the room.

onError (err)

Triggered whenever an error has occurred in the room handler.

License

MIT.

Package Sidebar

Install

npm i shopee-colyseus-loadtest

Homepage

colyseus.io/

Weekly Downloads

2

Version

0.14.3

License

MIT

Unpacked Size

17.4 kB

Total Files

6

Last publish

Collaborators

  • mramadhanrh