Skip to content

irunika/websocket-test-bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WebSocket Test Bench

This is a test bench for WebSocket. This can be used to test a WebSocket server with number of concurrent users with different payload sizes and different time periods. This test bench does not wait for a message round trips in order to send the next message to the server. Instead it sends messages without delays to the server and expect the echo back of it with the same sequence.

Building the project

Prerequisites

  • Java 8
  • Maven

Steps to build

  • Clone the project
  • Run mvn package in the project derectory
  • You can find the websocket-test-bench-jar-with-dependencies.jar jar file on target directory

Running the test bench

java -jar websocket-test-bench-jar-with-dependencies.jar <options>

Options

option description default value
-u , --url URL of the server (Mandotory) Non
-n , --connections No of connections to be made to the server 1
-m , --messages No of messages to be sent to the server per connection (This is not valid with -t option) 100
-p , --payload Payload size of a message in bytes 100
-t , --time Time period which test should run in minutes (If this option is enabled then messages will be sent for a given period of time ignoring the -m option) 0
-d , --delay Delay between two consecutive messages in a given client 0

eg: java -jar websocket-test-bench-jar-with-dependencies.jar -u ws://localhost:15500/websocket -n 10 -m 100

Test Result

At the end of the test following results can be obtained

Result indicator Description
TPS per each client Transactions per second per each client
Average TPS per client This is obtained as a average TPS per each client
Total time taken for the test This indicates the total time taken for the test to complete in minutes
Max no of concurrent connections Even though we specify the no of concurrent connections for a given test, server might not be able to handle them.This indicate such situations.
eg: In the test 1000 connections are specified to be connected to the server but server can handle only 700 connections concurrently
Total no of message round trips Total number of messages which are sent and received
No of error messages This test bench expect the same message to be echo backed from the server. If not this indicates the no of error messages received out of the total no of messages sent and received.
Throughput Throughput of the server