Socket
Book a DemoInstallSign in
Socket

ruby-mqtt-bench

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ruby-mqtt-bench

0.0.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

ruby-mqtt-bench

mqtt-bench for ruby

This project is deeply inspired by mqtt-bench. Ruby cannot provide the same performance as golang. This code is provided just for debugging purposes.

Installation

gem install ruby-mqtt-bench

How to use

ruby-mqtt-bench conf/mqtt_bench.conf

Configuration

The configuration can be modified by editing mqtt_bench.conf as follows. mqtt_opts are passed to ruby-mqtt and bench_opts are used locally in ruby-mqtt-bench.

vi conf/mqtt_bench.conf
{
  "mqtt_opts": {
    "host": "127.0.0.1",
    "port": 1883,
    "keep_alive": 15
  },
  "bench_opts": {
    "topic": "mqtt_bench",
    "num_clients": 128,
    "data_size": 64,
    "num_msgs": 1000,
    "interval": 0,
    "time_key": "time",
    "timestamp": "timestamp"
  }
}
  • topic: topic to be published
  • num_clients: number of clients connecting to a target broker simultaneously
  • data_size: message size
  • num_msgs: total number of messages sent to a target broker
  • interval: message sending interval
  • time_key: attribute name of time when the message was published
  • timestamp: attribute name for passing timestamp information to fluentd (default nil)

Message is created in JSON format. Because each message has minimum fields, minimum message size can be calculated as follows:

Example message:

{:cid=>"001", :data=>"", :mid=>"00001", :time=>1455754303515}

Field name and symbols have 50 bytes. "data" field size can be specified in configuration. "cid" (client id) and "mid" (message id) have number of digits with maximum number specified in configuration (num_clients and num_msgs. Time to send a message is recorded in the message as time field in ms.

FAQs

Package last updated on 06 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.