Giter Site home page Giter Site logo

websocket-benchmarker's Introduction

Build Status

📻 WebSocket Benchmarker ⌚

Message throughput is how fast a WebSocket server can parse and respond to a message. Some people consider this to be a good reference of a framework/library/server's performance. This tool measures the message throughput under load by mocking concurrent clients.




2019.01.26

Now with 100% more bleeding edge ⚡ asyncio goodness.



Installation

Python 3.6.5+.

pip install -r requirements.txt


Usage

This program expects the host to be an echo server and measures the time between sending a message and recieving the same message back from the host. It performs this for a number of client connections simultaneously and is designed to produce repeatable results.

python bench.py will launch the benchmark and print statistics to stdout. If the log file path is to a non-file then one will be created otherwise results will be appended to the existing file.

The raw results are in CSV format with each line representing a client's roundtrip times.

E.g., 0.1, 0.1, 0.1 for one client performing three roundtrips.


Arg Description Default
--h Host address of WebSocket server localhost:3000
--n Number of clients to create 1000
--c Number of concurrent clients 64
--r Roundtrips per client 5
--s Message size in characters 30
--l Path to create or append to a log file ./log.txt

Tests

Full end-to-end testing via unittest.

python -m unittest
...
----------------------------------------------------------------------
Ran 3 tests in 8.371s

OK

License

MIT (c) 2019 healeycodes.

Inspiration taken from the unmaintained JavaScript project websocket-benchmark.

websocket-benchmarker's People

Contributors

healeycodes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.