问题描述
我正在尝试使用 Jmeter
的插件(jmeter-websocket).问题是该插件没有提供如何使用它的文档,因此我不确定我对它的期望是否得到支持.
I'm trying to stress test my WebSocket
server using Jmeter
's plugin (jmeter-websocket). The thing is that the plugin comes with no documentation how to work with it and thus I'm not sure if my expectations of it is supported or not.
我设法使用上述插件运行了一个示例测试,并成功连接到服务器.它还设法与服务器通信,但一旦接收到第一个响应,它就会断开连接.我希望以某种方式配置此插件,以便它与 WebSocket
服务器保持持续连接几分钟,在断开连接之前发送和接收几条消息.
I managed to run a sample test using the mentioned plugin and it was successfully connected to server. It also managed to communicate with server but once it was done receiving the first response it disconnected. I was hoping to configure this plugin in a way so it will maintain a persistent connection with WebSocket
server for several minutes, sending and receiving a couple of messages before it is disconnected.
通过压力测试,我想看看并发连接的数量如何影响我的应用程序的行为.这个插件适合我的需求吗?如果是,那么我应该如何处理它?
By stress testing I would like to see how the number of concurrent connections affect my application's behavior. Is this plugin suitable for my needs? If it is then how should I work with it?
推荐答案
我遇到了完全相同的问题.您提到的插件仅适用于类似 HTTP 的请求/响应,但我无法将其用于长"连接.
I had exactly the same problem. the plugin you have mentioned worked only for a HTTP-like request/response but I couldn't use it for a "long" connection.
看看这个 http://github.com/maciejzaleski/JMeter
特点:
- 支持 HTTS/HTTPS (ws/wss) 版本的 WebSocket 协议
- 忽略 SSL 证书错误的选项
- 流式传输允许单个连接在测试期间保持打开状态
- 响应必须匹配预定义的正则表达式
- 响应超时
- 响应消息积压(从多个服务器消息构建采样器响应)
- 如果服务器发送匹配预定义正则表达式的消息,连接可能会关闭
这篇关于Jmeter 中的压力测试 WebSockets的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!