Giter VIP home page Giter VIP logo

Comments (15)

jinfahua avatar jinfahua commented on May 20, 2024

Please refer to comment #5 (comment) for similar question.

Also, we're developing a new feature to control the received message precisely which was mentioned in #10 . E.g, sub sampler will be produced on receiving x (x can be configured to 1 ~ n) of message. The feature is still under testing. To try it, you can checkout code from timer_sub branch, and build the JAR by yourself.

from mqtt-jmeter.

god-pane avatar god-pane commented on May 20, 2024

image
我要模拟即连即挺的情况,是将Connection keep time 参数设置为0吗? 关闭脚步就停止发包,下线了。

from mqtt-jmeter.

jinfahua avatar jinfahua commented on May 20, 2024

Connection sampler主要用于模拟背景连接,除了ping包不发送任何别的数据。如果模拟即连即停,不发送数据的话,可以按照你说的这样做。不知道这是模拟的什么样的场景?

from mqtt-jmeter.

rende2005 avatar rende2005 commented on May 20, 2024

按照目前的实现方式,Connection keep time设置0,就是连接建立后立即正常disconnect,这样就没有机会发ping包了。你可以看到sampler很快执行完(连接建立的花费时间其实很短)。

在Connection keep time != 0的情况下,如果你在GUI里点击stop按钮来停止脚本,插件会感知到并主动disconnect再结束执行; 如果以其它方式强行关闭脚本,可能要依靠服务器端感知客户端断连并清理,问题也不大。

from mqtt-jmeter.

god-pane avatar god-pane commented on May 20, 2024

这个地方默认是1800s 即30分钟, keep alive默认为300s 即5分钟, 我正常连接成功后,停止脚本,但是心跳包根本没有停止发送,还是每隔5分钟发一次,导致我再次开启脚步来连接时,不能连接成功,提示连接已存在了。我只能关闭jmeter来解决这个问题。

from mqtt-jmeter.

rende2005 avatar rende2005 commented on May 20, 2024

你是怎么停止脚本的?你说的情况好像连接并没有断开,可以设法从server端查看连接状况确认一下。

from mqtt-jmeter.

god-pane avatar god-pane commented on May 20, 2024

image 查看了的哈, 确认没有断开,还有心跳包。

from mqtt-jmeter.

god-pane avatar god-pane commented on May 20, 2024

该问题是 开始脚本(正常建立连接), 然后再停止脚本,多重复了几次,就出现。

from mqtt-jmeter.

rende2005 avatar rende2005 commented on May 20, 2024

我确认一下:你现在是用的缺省的keep time=1800s, keep alive=300s? 然后GUI上点开始、结束,重复几次就有没断开的连接,是吧?

我们可能需要查看一下jmeter.log, 看disconnect是不是没有做成功。

另外,如果你不关心保持背景连接,即连即停,用keep time=0有什么问题吗? 为什么要手工停止脚本运行。你的测试场景我们不是特别明白。

from mqtt-jmeter.

god-pane avatar god-pane commented on May 20, 2024

keep time=0,没有问题,是即连即停。 手工停止脚本只是在做测试。
符合我这边最终场景是:客户端上线后,先publish,然后subscribe,再根据subscribe返回不同的信息publish,然后我还要操作一些http请求,验证客户端的publish信息。

from mqtt-jmeter.

rende2005 avatar rende2005 commented on May 20, 2024

了解。subscribe时选取合适的采样退出条件(可能是按收到的消息数=1),再分析返回的消息,做下一步的publish就可以了。

from mqtt-jmeter.

god-pane avatar god-pane commented on May 20, 2024

还有在循环控制器下面先Connection Sampler,然后再添加一个pub Sampler, 我发现连接成功后,pub Sampler根本没有执行

from mqtt-jmeter.

rende2005 avatar rende2005 commented on May 20, 2024

pub和sub里面都隐含了建立连接的过程,你不需要在pub前面放一个Connection Sampler.

Connection Sampler是用于构造背景长连接,你要是需要,可以把connection sampler放到一个单独的thread group里面。

from mqtt-jmeter.

god-pane avatar god-pane commented on May 20, 2024

明白了

from mqtt-jmeter.

god-pane avatar god-pane commented on May 20, 2024

谢谢

from mqtt-jmeter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.