GithubHelp home page GithubHelp logo

wxiao1002 / mqtt-bench Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 56 KB

MQTT client for bench broker.MQTT Broker 发布消息测试工具

License: Apache License 2.0

Go 97.18% Shell 2.82%
benchmarking iot mqtt-benchmark mqtt-client mqtt-protocol

mqtt-bench's Introduction

MQTT Bench

MQTT 发布消息测试工具

快速开始

编译好的程序包

./mqtt-bench-linux -csvPath /root/clients.csv -broker tcp://localhost:1883 -clients 1000 -benchmarkTime 20 -messageInterval 1
  • 上述示范是 读取/root/clients.csv 文件解析用户名密码,生成1000个客户端并连接到 tcp://localhost:1883 ,以1秒一条的消息频率发布消息测试20 分钟

源码运行

go run main.go -csvPath /root/clients.csv -broker tcp://localhost:1883 -clients 1000 -benchmarkTime 20 -messageInterval 1

参数解析

  • broker :mqtt broker 地址
  • csvPath:读取用户密码地址,第一列用户,第二列密码
  • clients:创建多少个连接,csv 读取到的数目大于等于该值
  • benchmarkTime: 压测时间,分钟开始
  • messageInterval:生产消息的时间间隔,秒
  • topic:发布主题,为空的话 会是 api/{username}/attributes,username 是占位符到时候会自动替换成用户名

运行结果

pPdN091.png

打包

  • sh build/linux.sh
  • sh build/linux_arm.sh
  • sh build/windows.sh

english doc

[./README-en.md]

mqtt-bench's People

Contributors

wxiao1002 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

mqtt-bench's Issues

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.