1.4.2 • Published 3 years ago

ws-benchmark v1.4.2

Weekly downloads
64
License
MIT
Repository
github
Last release
3 years ago

ws-benchmark

Dependency Status devDependency Status Build Status: Windows Github CI Github CI npm version Downloads type-coverage

A CLI tool for websocket, like apache bench for http.

install

yarn global add ws-benchmark

usage

run ws-benchmark "ws://localhost:8080" -c 10 -n 2000

supported protocols

  • ws: ws-benchmark "ws://localhost:8080" -c 10 -n 2000
  • wss: ws-benchmark "wss://localhost:8080" -c 10 -n 2000
  • http: ws-benchmark "http://localhost:8080" -c 10 -n 2000
  • https: ws-benchmark "https://localhost:8080" -c 10 -n 2000
  • socket.io: ws-benchmark "ws://localhost:8080/socket.io/?transport=websocket" -c 10 -n 2000

optional parameters

namedefaultdescription
-c-c 1Number of multiple requests to make at a time(the count of http clients or websocket connections)
-n-n 1Number of requests to perform
-m-m GETMethod name
-s-s 30Seconds to max. wait for each response
-fFile containing data to request. Remember also to set -T
-T-T 'text/plain'Content-type header to use
-CAdd cookie, eg. 'Apache=1234'
-HAdd Arbitrary header line, eg. 'Accept-Encoding: gzip'
-kUse HTTP KeepAlive feature
-h,--helpPrint this message.
-v,--versionPrint the version

result example

Completed 200 requests
Completed 400 requests
Completed 600 requests
Completed 800 requests
Completed 1000 requests
Completed 1200 requests
Completed 1400 requests
Completed 1600 requests
Completed 1800 requests
Completed 2000 requests
Concurrency Level:      10
Time taken for tests:   0.196 seconds
Complete requests:      2000
Failed requests:        0
Requests per second:    10182.00 [#/sec] (mean)
Time per request:       0.982 [ms] (mean)
Time per request:       0.098 [ms] (mean, across all concurrent requests)
Average time:           0.069 [ms]
Min time:               0.032 [ms]
Max time:               1.612 [ms]

Percentage of the requests served within a certain time (ms)
  50%      0.060
  66%      0.068
  75%      0.077
  80%      0.081
  90%      0.093
  95%      0.102
  98%      0.110
  99%      0.129
 100%      1.612
1.4.2

3 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.0

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago