vernemq / vmq_mzbench

An MQTT loadtest and usage scenario tool for VerneMQ and other MQTT systems.
Apache License 2.0
42 stars 44 forks source link

Plugin doesn't compile #22

Closed trippinCode closed 6 years ago

trippinCode commented 6 years ago

So i tried including your plugin in my load test and i got following Syntax error compiling

12:29:17.499 [error] [ API ] <0.298.0> Stage 'pipeline - provisioning': failed
Command returned 2:
 bash -c -l "export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'; mkdir -p /tmp/bench_mzbench_api_e9fa23c3e463_1521_30547_430255 && cd /tmp/bench_mzbench_api_e9fa23c3e463_1521_30547_430255 && git clone https://github.com/erlio/vmq_mzbench.git deployment_code && cd deployment_code && git checkout master && cd ./. && make generate_tgz && mv *.tgz /tmp/bench_mzbench_api_e9fa23c3e463_1521_30547_430138.tgz "
Command output: Cloning into 'deployment_code'...
Already on 'master'
/tmp/bench_mzbench_api_e9fa23c3e463_1521_30547_430255/deployment_code/rebar get-deps
==> deployment_code (get-deps)
Pulling lager from {git,"git://github.com/basho/lager.git",{tag,"2.2.3"}}
Cloning into 'lager'...
Pulling vmq_commons from {git,"git://github.com/erlio/vmq_commons.git",
                              "7b6171b"}
Cloning into 'vmq_commons'...
==> lager (get-deps)
Pulling goldrush from {git,"git://github.com/DeadZen/goldrush.git",
                           {tag,"0.1.8"}}
Cloning into 'goldrush'...
==> goldrush (get-deps)
==> vmq_commons (get-deps)
/tmp/bench_mzbench_api_e9fa23c3e463_1521_30547_430255/deployment_code/rebar compile
==> goldrush (compile)
Compiled src/gr_counter_sup.erl
Compiled src/gr_manager_sup.erl
Compiled src/gr_manager.erl
Compiled src/gr_app.erl
Compiled src/glc_ops.erl
Compiled src/gr_context.erl
Compiled src/gr_counter.erl
Compiled src/gre.erl
Compiled src/gr_param_sup.erl
Compiled src/gr_sup.erl
Compiled src/glc.erl
Compiled src/glc_lib.erl
Compiled src/gr_param.erl
Compiled src/glc_code.erl
==> lager (compile)
Compiled src/lager_util.erl
Compiled src/lager_transform.erl
Compiled src/lager_crash_log.erl
Compiled src/lager.erl
Compiled src/lager_sup.erl
Compiled src/lager_common_test_backend.erl
Compiled src/lager_handler_watcher.erl
Compiled src/lager_format.erl
Compiled src/lager_config.erl
Compiled src/lager_console_backend.erl
Compiled src/lager_backend_throttle.erl
Compiled src/lager_stdlib.erl
Compiled src/lager_msg.erl
Compiled src/lager_handler_watcher_sup.erl
Compiled src/lager_app.erl
Compiled src/lager_trunc_io.erl
Compiled src/lager_default_formatter.erl
Compiled src/lager_file_backend.erl
Compiled src/error_logger_lager_h.erl
==> vmq_commons (compile)
Compiled src/auth_on_register_hook.erl
Compiled src/gen_emqtt.erl
Compiled src/on_unsubscribe_hook.erl
Compiled src/msg_store_plugin.erl
Compiled src/on_client_wakeup_hook.erl
Compiled src/on_subscribe_hook.erl
Compiled src/on_publish_hook.erl
Compiled src/on_offline_message_hook.erl
Compiled src/on_register_hook.erl
Compiled src/auth_on_subscribe_hook.erl
Compiled src/on_deliver_hook.erl
Compiled src/on_config_change_hook.erl
Compiled src/on_client_offline_hook.erl
Compiled src/auth_on_publish_hook.erl
Compiled src/on_client_gone_hook.erl
Compiled src/vmq_topic.erl
Compiled src/vmq_parser.erl
==> deployment_code (compile)
src/mqtt_worker.erl:54: syntax error before: '{'
src/mqtt_worker.erl:4: function metrics/0 undefined
ERROR: compile failed while processing /tmp/bench_mzbench_api_e9fa23c3e463_1521_30547_430255/deployment_code: rebar_abort
make: *** [compile] Error 1
ioolkos commented 6 years ago

@trippinCode thanks.. can you show how you included the vmq_mzbench worker?

trippinCode commented 6 years ago

@ioolkos thanks for the quick reply. Do you mean the scenario code?

#!benchDL
make_install(git = "https://github.com/erlio/vmq_mzbench.git",
branch = "master")

pool(size = 1000,
worker_type = mqtt_worker,
worker_start = poisson(1000 rps)):

        connect([t(host, "217.172.184.56"),
                t(port,1883),
                t(client,fixed_client_id("", worker_id())),
                t(clean_session,true),
                t(keepalive_interval,60),
                t(proto_version,4), t(reconnect_timeout,4)
                ])

        set_signal(connect1, 1)
        wait_signal(connect1, 1000)
        wait(4 sec)
        loop(time = 5 min, rate = 1 rps):
            publish_to_self("foo", random_binary(240), 3)
        disconnect()
ioolkos commented 6 years ago

Yes, thanks. You don't need to do more than just include vmq_mzbench with the make_install directive in your script file. That should be it.

Do you try to achieve something more or different?

ioolkos commented 6 years ago

Also note that there is no QoS 3. (in your publish_to_self directive). The broker should probably reject that.

trippinCode commented 6 years ago

I get the error while i'm doing this.

ioolkos commented 6 years ago

@trippinCode Hi, do you have an idea what happens, or do you have gathered more information?

ioolkos commented 6 years ago

Just seen https://github.com/satori-com/mzbench/issues/134 Is this issue related?

trippinCode commented 6 years ago

@ioolkos yes, i wrote my own MQTT testing tool to test the brokers, so sorry for the effort.

ioolkos commented 6 years ago

@trippinCode no worries & apologies I couldn't be more helpful. And yay for doing your own testing tool! :smiley:

nickfloop commented 6 years ago

I am still getting this error with the current master branch of this repo. My scenario is the same as @trippinCode 's scenario. Are there any plans to fix the compilation issues? Thanks.

ioolkos commented 6 years ago

@nickfloop thanks for opening the issue.

So...

  1. you cloned and compiled MZBench (with what Erlang version btw?)
  2. you started MZBench and loaded an MQTT scenario file via the Web GUI
  3. and then the MZBench web GUI shows the exact same syntax error as in the comment opening this issue?

are those steps mirroring what you did? just making sure as a first step.