Skip to content

Instantly share code, notes, and snippets.

@piyushgupta27
Created June 22, 2019 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piyushgupta27/d05a5a3696732886b6e62b6d1d83f263 to your computer and use it in GitHub Desktop.
Save piyushgupta27/d05a5a3696732886b6e62b6d1d83f263 to your computer and use it in GitHub Desktop.
MZBench MQTT Broadcast Scenario
#!benchDL
make_install(git = "https://github.com/erlio/vmq_mzbench.git",
branch = "master")
pool(size = numvar("connections"),
worker_type = mqtt_worker,
worker_start = linear(numvar("rate") rps)):
connect(host = var("sub_node"),
client = fixed_client_id("subscriber_pool0_1", worker_id()),
clean_session = true,
keepalive_interval = 60,
proto_version = 3,
reconnect_timeout = 4,
port = 1883
)
wait(10 sec)
subscribe("b/loadtest", 0)
wait(1 sec)
set_signal(subscribed, 1)
wait(10 sec)
wait_signal(subscribed, numvar("connections"))
wait(numvar("duration") min)
disconnect()
wait(10 sec)
pool(size = 1,
worker_type = mqtt_worker):
connect(host = var("pub_node"),
client = fixed_client_id("publisher_pool0_1", worker_id()),
clean_session = true,
keepalive_interval = 60,
proto_version = 3,
reconnect_timeout = 4,
port = 1883
)
wait(1 sec)
wait_signal(subscribed, numvar("connections"))
wait(1 sec)
dump("Starting Publish")
loop(time = numvar("duration") min, rate = 1 rps, iterator = "i"):
publish("b/loadtest", random_binary(1000), 0)
wait(1 sec)
disconnect()
wait(10 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment