• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mqttws-jmeter: Jmeter MQTT sampler with support for websockets

原作者: [db:作者] 来自: 网络 收藏 邀请

mqttws-jmeter

Jmeter MQTT sampler with support for websockets

Initially a fork of https://github.com/tuanhiep/mqtt-jmeter.

Introduction

The MQTTWS Plugin in Jmeter is used for the injection testing of MQTT brokers.It uses paho client (https://repo.eclipse.org/content/repositories/paho-snapshots/)that supports MQTT over tcp, websockets and secure websockets.

How to install MQTTWS plugin in Jmeter

From the repository: https://github.com/winglet/mqttws-jmeter
Get the source code, go to mqttws-jemeter folder and and use the command maven in terminal (Ubuntu):

mvn clean install package

or (eclipse with maven support http://www.eclipse.org/m2e/) select pom.xml and "Run As" "maven clean" and then "Run As" "maven install".

This should result in the file mqttws-jmeter.jar in mqttws-jmeter/target.
Put the mqttws-jemeter.jar in the folder lib/ext of Jmeter(to be downloaded on http://jmeter.apache.org/download_jmeter.cgi ).

It's necessary to update the file ApacheJMeter_core.jar in the repository lib/ext of Jmeter (that is if you care to see MQTTWS strings properly in GUI).Update the file messages.properties in the folder :/org/apache/jmeter/resources/in ApacheJMeter_core.jar by new file messages.properties fromhttps://github.com/winglet/mqttws-jmeter/tree/master/ressource

MQTTWS Publisher

Right-click "Threads" and choose : Add > Sampler > MQTTWS Publisher

In the principal interface of MQTTWS Publisher we have the fields:
Connection Info

Name: Name of the MQTTWS Publisher
Comments: Your comments
Provider URL: the address of MQTTWS server example: tcp://localhost:1883
Client Id: Your Id in the session with MQTTWS server example: Noel De Palma
List Topic: The topic name you want to publish to
Use Authorization check box: Necessary in the case the connection needs the username andpassword
User: Your username
Password: Your password
Number of samples to aggregate: In other way, the number of messages you want to publish tothe MQTT sever in this MQTT Publisher thread, with the value like the configuration below.
mqtt connection timeout: The time (msecs) the sampler will wait for a successful connection with the broker.publisher throttle: The time (msecs) that the publisher will wait amongst two consecutive messages.Message Type: You can choose : Text, Random Byte Array (more detail below)

Option

Add TimeStamp check box: Add the timestamps to the message. The timestamps is 8 bytes
Add Number Sequence check box: Add the number sequence to the message. Example: if youpublish 100 messages in your session, the message is numbered from 0 to 99. The number sequencefield in the message is 4 bytes.
Retained check box: You publish the messages as retained messages or not. The retain flag for anMQTT message is set to false by default. This means that a broker will not hold onto the messageso that any subscribers arriving after the message was sent will not see the message. By settingthe retain flag, the message is held onto by the broker, so when the late arrivers connect to thebroker or clients create a new subscription they get all the relevant retained messages
Quality of service: Three levels according to MQTT protocol QoS:
0 : At most once
1 : At least once
2 : Exactly once
Bear in mind that for QoS 1 and 2 the publisher will report failure if it does not manage getting back ACKs for all its messages.

Content

With MQTT Publisher in Jmeter, three type of messages can be sent (Message Type):

Text

Text send as is.

Random Byte Array:

The data in form of random byte array with the size array as an input.

For measuring, thanks to Jmeter, we can add some listeners:

MQTT Subscriber

Name: Name of the MQTT Subscriber
Comments: Your comments
Provider URL: The address of MQTT server
Client Id: Your Id in the session
Topic: The topic you want to subscribe.
Use Authorization : Necessary in the case the connection need username and password
mqtt connection timeout: Msecs to wait for a successful connectionUser: your username
Password: your password
Number of samples to aggregate: In other way, the number of message you want to receive fromthe topic in one session
Time out (milliseconds): Timeout for the connection to receive message from the topic


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap