Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lyouthzzz/websocket-benchmark-cli
https://github.com/lyouthzzz/websocket-benchmark-cli
benchmark websocket
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lyouthzzz/websocket-benchmark-cli
- Owner: lyouthzzz
- Created: 2022-11-02T07:49:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-23T10:26:14.000Z (about 2 years ago)
- Last Synced: 2024-06-20T13:36:50.231Z (8 months ago)
- Topics: benchmark, websocket
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# websocket-benchmark-cli
- 支持连接压测
- 支持IO吞吐压测## install
```bash
go get github.com/lyouthzzz/websocket-benchmark-cli@main
```## websocket-benchmark-cli
```bash
websocket-benchmark-cli -h
NAME:
websocket-benchmark-cli - websocket benchmark toolUSAGE:
websocket-benchmark-cli [global options] command [command options] [arguments...]VERSION:
v1.0.1COMMANDS:
conn websocket connection benchmark
message websocket message benchmark
help, h Shows a list of commands or help for one commandGLOBAL OPTIONS:
--host value (default: "localhost:8080")
--path value (default: "/ws")
--user value (default: 500)
--connectInterval value (default: "20ms")
--help, -h show help (default: false)
--version, -v print the version (default: false)
```### 全局参数
- host: websocket服务host
- path: websocket路径
- user: 用户连接数量
- connectInterval: 连接间隔## 连接压测
#### command
```bash
websocket-benchmark-cli conn -h
NAME:
websocket-benchmark-cli conn - websocket connection benchmarkUSAGE:
websocket-benchmark-cli conn [command options] [arguments...]OPTIONS:
--host value (default: "localhost:8080")
--path value (default: "/ws")
--user value (default: 500)
--connectInterval value (default: "20ms")
--sleep value (default: "60m")
--help, -h show help (default: false)
```- sleep:连接保持时间
#### example
```
websocket-benchmark-cli conn --host localhost:8888 --connectInterval 30ms --user 10000 --sleep 1h
```## 消息吞吐压测
#### command
```bash
websocket-benchmark-cli message -h
NAME:
websocket-benchmark-cli message - websocket message benchmarkUSAGE:
websocket-benchmark-cli message [command options] [arguments...]OPTIONS:
--host value (default: "localhost:8080")
--path value (default: "/ws")
--user value (default: 500)
--connectInterval value (default: "20ms")
--content value (default: "hello world")
--file value
--interval value (default: "1s")
--times value (default: 100)
--help, -h show help (default: false)
```- content:发送的消息主体
- file:读取的文件作为发送的消息主体,适合大文件
- interval:发送消息的间隔
- times:发送消息的总次数#### example
```bash
websocket-benchmark-cli message --host localhost:8888 --connectInterval 30ms --user 1000 --content messagebody
```### todo
- report指标