Skip to content

Commit

Permalink
feat: add ws/wss example
Browse files Browse the repository at this point in the history
  • Loading branch information
linkxzhou committed Aug 4, 2024
1 parent 34c5929 commit c749787
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 312 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ Example stress test for http/3:
./http_bench -d 10s -c 10 -http http3 -m POST "http://127.0.0.1/test1" -body "{}"
```

Example stress test for ws/wss:
```
./http_bench -d 10s -c 10 -http ws -m POST "ws://127.0.0.1" -body "{}"
```

Example distributed stress test(print detail info "-verbose 1"):
```
(1) First step:
Expand Down
5 changes: 5 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ Latency distribution:
./http_bench -d 10s -c 10 -http http3 -m POST "http://127.0.0.1/test1" -body "{}"
```

执行压测,使用ws/wss:
```
./http_bench -d 10s -c 10 -http ws -m POST "ws://127.0.0.1" -body "{}"
```

分布式压测样例(使用"-verbose 1"打印详细日志):
```
(1) 第一步:
Expand Down
23 changes: 20 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
module github.com/linkxzhou/http_bench

go 1.16
go 1.21

toolchain go1.22.1

require (
github.com/gorilla/websocket v1.5.0
github.com/quic-go/quic-go v0.32.0
golang.org/x/net v0.4.0
github.com/quic-go/quic-go v0.45.2
golang.org/x/net v0.25.0
)

require (
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/onsi/ginkgo/v2 v2.9.5 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/stretchr/testify v1.8.2 // indirect
go.uber.org/mock v0.4.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/tools v0.21.0 // indirect
)
Loading

0 comments on commit c749787

Please sign in to comment.