All Projects → mnogu → gatling-mqtt

mnogu / gatling-mqtt

Licence: Apache-2.0 license
A Gatling stress test plugin for MQTT

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to gatling-mqtt

gatling-sbt-plugin
Gatling Plugin for SBT
Stars: ✭ 105 (+183.78%)
Mutual labels:  gatling
zabbix-server-stress-test
How many new value per second can be handled by your Zabbix server?
Stars: ✭ 28 (-24.32%)
Mutual labels:  stress-test
homely
🏠 - A bunch of mosquittos. IoT wiring and notification framework, with an unix style.
Stars: ✭ 15 (-59.46%)
Mutual labels:  mqtt
ReplayZero
Record local web traffic on your laptop and generate functional API tests, utilizing open source industry standards like Karate and Gatling
Stars: ✭ 25 (-32.43%)
Mutual labels:  gatling
arion
gRPC toolkit for Go
Stars: ✭ 73 (+97.3%)
Mutual labels:  stress-test
ESP8266 mqtts
Arduino IDE project: send data from DS18B20 temperature sensor to mqtt.flespi.io via MQTT over SSL.
Stars: ✭ 16 (-56.76%)
Mutual labels:  mqtt
spring-boot-web-application-sample
Real World Spring Boot Web Application Example with tons of ready to use features
Stars: ✭ 143 (+286.49%)
Mutual labels:  gatling
ocaml-mqtt
MQTT client for OCaml/ReasonML
Stars: ✭ 14 (-62.16%)
Mutual labels:  mqtt
gatling-amqp-plugin
Plugin for support performance testing with AMQP in Gatling (3.7.x)
Stars: ✭ 26 (-29.73%)
Mutual labels:  gatling
zwave-core
Flexible Z-Wave Service Server - Access your Z-Wave nodes fast and independent - Planned/supported: REST-API, Browser UI, MQTT* - Perfect for maintaining big node-numbers, drop-in ozwcp replacement!
Stars: ✭ 19 (-48.65%)
Mutual labels:  mqtt
avalanche
Minecraft server stress test tool.
Stars: ✭ 48 (+29.73%)
Mutual labels:  stress-test
Orion-Stress-Tester
A simple, efficient and accurate stress tester, support HTTP, WebSocket and TCP
Stars: ✭ 32 (-13.51%)
Mutual labels:  stress-test
102shows
Raspberry Pi + APA102 + MQTT + 102shows = LED awesomeness!
Stars: ✭ 15 (-59.46%)
Mutual labels:  mqtt
gatling-maven-plugin
Gatling Plugin for Maven
Stars: ✭ 30 (-18.92%)
Mutual labels:  gatling
awesome-gatling
A collection of resources covering different aspects of Gatling load-testing tool usage.
Stars: ✭ 36 (-2.7%)
Mutual labels:  gatling
mtss-gan
MTSS-GAN: Multivariate Time Series Simulation with Generative Adversarial Networks (by @firmai)
Stars: ✭ 77 (+108.11%)
Mutual labels:  stress-test
sample-testing-microservices
sample applications with implementation of unit, component, contract and integrarion tests using pact, gatling, spring boot test and hoverfly
Stars: ✭ 22 (-40.54%)
Mutual labels:  gatling
rpi2mqtt
Connect RaspberryPi GPIOs and 1-Wire temperature sensors to MQTT 🍰🔘📡
Stars: ✭ 20 (-45.95%)
Mutual labels:  mqtt
ccu-addon-mosquitto
Mosquitto packaged as Addon for the Homematic CCU3 and RaspberryMatic
Stars: ✭ 23 (-37.84%)
Mutual labels:  mqtt
mqttools
MQTT version 5.0 client and broker using asyncio
Stars: ✭ 44 (+18.92%)
Mutual labels:  mqtt

Gatling-MQTT

An unofficial Gatling stress test plugin for MQTT.

Usage

Cloning this repository

$ git clone https://github.com/mnogu/gatling-mqtt.git
$ cd gatling-mqtt

Creating a jar file

Install sbt 0.13 if you don't have. And create a jar file:

$ sbt assembly

If you want to change the version of Gatling used to create a jar file, change the following line in build.sbt:

"io.gatling" % "gatling-core" % "2.2.3" % "provided",

and run sbt assembly.

Putting the jar file to lib directory

Put the jar file to lib directory in Gatling:

$ cp target/scala-2.11/gatling-mqtt-assembly-*.jar /path/to/gatling-charts-highcharts-bundle-2.2.*/lib

Creating a simulation file

$ cp gatling-mqtt/src/test/scala/com/github/mnogu/gatling/mqtt/test/MqttSimulation.scala /path/to/gatling-charts-highcharts-bundle-2.2.*/user-files/simulations
$ cd /path/to/gatling-charts-highcharts-bundle-2.2.*
$ vi user-files/simulations/MqttSimulation.scala

This plugin supports the following options:

  • host
  • clientId
  • cleanSession
  • keepAlive
  • userName
  • password
  • willTopic
  • willMessage
  • willQos
  • willRetain
  • version
  • connectAttemptsMax
  • reconnectAttemptsMax
  • reconnectDelay
  • reconnectDelayMax
  • reconnectBackOffMultiplier
  • receiveBufferSize
  • sendBufferSize
  • trafficClass
  • maxReadRate
  • maxWriteRate

See the document of mqtt-client for the description of these options. For example, the host option corresponds setHost() method in mqtt-client. That is, you can obtain an option name in this plugin by removing set from a method name in mqtt-client and then making the first character lowercase.

The following options also support Expression:

  • host
  • clientId
  • userName
  • password
  • willTopic
  • willMessage
  • version

Here is a sample simulation file:

import io.gatling.core.Predef._
import org.fusesource.mqtt.client.QoS
import scala.concurrent.duration._

import com.github.mnogu.gatling.mqtt.Predef._

class MqttSimulation extends Simulation {
  val mqttConf = mqtt
    // MQTT broker
    .host("tcp://localhost:1883")

  val scn = scenario("MQTT Test")
    .exec(mqtt("request")
      // topic: "foo"
      // payload: "Hello"
      // QoS: AT_LEAST_ONCE
      // retain: false
      .publish("foo", "Hello", QoS.AT_LEAST_ONCE, retain = false))

  setUp(
    scn
      .inject(constantUsersPerSec(10) during(90 seconds)))
    .protocols(mqttConf)
}

The following parameters of publish() support Expression:

  • topic
  • payload

Here is a bit complex sample simulation file:

import io.gatling.core.Predef._
import org.fusesource.mqtt.client.QoS
import scala.concurrent.duration._

import com.github.mnogu.gatling.mqtt.Predef._

class MqttSimulation extends Simulation {
  val mqttConf = mqtt
    .host("tcp://localhost:1883")
    // clientId: the values of "client" column in mqtt.csv
    //
    // See below for mqtt.csv.
    .clientId("${client}")

  val scn = scenario("MQTT Test")
    // The content of mqtt.csv would be like this:
    //
    //   client,topic,payload
    //   clientId1,topic1,payload1
    //   clientId2,topic2,payload2
    //   ...
    .feed(csv("mqtt.csv").circular)
    .exec(mqtt("request")
      // topic: the values of "topic" column in mqtt.csv
      // payload: the values of "payload" column in mqtt.csv
      // QoS: AT_LEAST_ONCE
      // retain: false
      .publish("${topic}", "${payload}", QoS.AT_LEAST_ONCE, retain = false))

  setUp(
    scn
      .inject(constantUsersPerSec(10) during(90 seconds)))
    .protocols(mqttConf)
}

Running a stress test

After starting an MQTT broker, run a stress test:

$ bin/gatling.sh

License

Apache License, Version 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].