Created
June 22, 2019 07:23
-
-
Save piyushgupta27/d05a5a3696732886b6e62b6d1d83f263 to your computer and use it in GitHub Desktop.
MZBench MQTT Broadcast Scenario
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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