Comments (2)
这里并发数 从 0(1s时候) => 10(2s时候),webSocket 是连接成功了,从错误码来看应该是验证器校验返回结果没有通过
- 调试模式查看,可以查看到返回数据是什么
go run main.go -c 10 -n 1 -d true -u ws://127.0.0.1:4455/
- 自定义 webSocket 验证器
webSocket 压测的时候在接收请求返回数据的时候会验证结果是否正确,验证函数如下文件处:
正确的返回数据示例:{"seq":"1566276523281-585638","cmd":"heartbeat","response":{"code":200,"codeMsg":"Success","data":null}}
因为各个业务不同,如果这个验证器不太合适,可以在这个函数处自行改造
// isSucceed 为验证是否成功,true的时候才成功数才可以+1
func WebSocketJson(request *model.Request, seq string, msg []byte) (code int, isSucceed bool)
- 自定义webSocket发送数据
如果需要自定义发送数据,可以修改 websocket_link.go 第91行位置
from go-stress-testing.
看了代码懂了,3q
from go-stress-testing.
Related Issues (20)
- Html report HOT 1
- websocket压测并发数上限为1万
- 发起websocket为什么需要暂停?而且暂停时间是1秒写的60秒 HOT 2
- go-stress不能测试get吗 HOT 1
- 可以支持从文件加载body吗?类似ab的-p参数 HOT 1
- websocket 协议没有透传header HOT 2
- 为什么接受数据使用channel接收数据缓存 HOT 1
- 发送http请求收到的body为空 HOT 3
- 支持 http proxy 和 socks5 proxy 吗? HOT 1
- 执行curl文件不能正确加载host HOT 1
- mac 无法安装 HOT 1
- GC相关的问题
- v1.0.6 的 exe 闪退 HOT 1
- 增加龙架构(loong64)的支持 HOT 1
- 溢出bug HOT 1
- mac intel x64 HOT 3
- 工具使用问题 HOT 1
- 如何不限制时长压测 HOT 6
- 可以支持并发多个请求吗 HOT 1
- 请求websocket 需要发送message的 怎么使用呢? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-stress-testing.