首页 文章

使用JMeter加载测试websocket并连续流式传输

提问于
浏览
0

JMeter 中的WebSocket流仅针对一个帧执行,我无法使用可用的jar加载测试连续流@ https://bitbucket.org/pjtr/jmeter-websocket-samplers

Jmeter WebSocket jmx当我尝试通过终端触发WebSocket请求时,它会传输输出/日志 . 但是在JMeter的情况下, Websocket 只运行一帧 .

端口443的WSS请求:

谢谢你回答了这个问题 . 请你明白我的一些疑问:我正在尝试加载测试客户端不断收听WebSocket的场景 .

1 Using a jar file I am able to continuously stream the data when I hit the java jar in the terminal. I can see the data flowing

2. Now I try to replicate the scenario in JMeter, the sampler acts like a request/response, where the connection is lost after the response.

3. Now if I set a loop in JMeter, it does not satisfy the purpose of streaming. It will act as multiple requests sent to the same channel.

此外,在附加的图像链接中,选中了流连接的复选框,但它的作用类似于请求/响应 .

Is looping the only option for WebSocket streaming?

线程名称:线程组1-1示例开始:2017-04-27 17:21:40 IST加载时间:1383连接时间:0延迟:0大小(字节):1065发送字节:0标头大小(字节):0正文size in bytes:1065 Sample Count:1 Error Count:0数据类型(“text”|“bin”|“”):响应代码:200响应消息:[Execution Flow] - 打开新连接 - 使用响应消息模式“” - 使用断开连接模式“” - 等待60000 MILLISECONDS的服务器连接 - 已打开WebSocket连接 - Build 连接 - 等待60000 MILLISECONDS的消息 - 接收帧#1(15字节);匹配的响应模式 - 收到的消息#2(15字节);匹配的响应模式 - 保持流连接打开[变量] - 消息计数:2 [问题]响应头:SampleResult字段:ContentType:DataEncoding:UTF-8

1 回答

  • 1

    (我不能发表评论,这对第一部分来说更合适)

    根据你帖子中的文字,你正在使用https://bitbucket.org/pjtr/jmeter-websocket-samplers,但你发布的日志不是来自那个插件,而是来自Maciej Zaleski的插件....

    我不是100%肯定你对“负载测试连续流”的意思,但如果你的意思是服务器只是将帧推送到客户端,那么可以使用前一个插件进行测试 . 只需使用“单读取采样器”设置循环......

相关问题