diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ce37b64..4d54edb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -73,7 +73,7 @@ jobs: run: cat rebar3.crashdump - run: ./_build/emqtt_bench/rel/emqtt_bench/bin/emqtt_bench - uses: actions/upload-artifact@v2 - if: startsWith(github.ref, 'refs/tags/') && matrix.quic_support + if: startsWith(github.ref, 'refs/tags/') with: name: packages path: ./*.tar.gz diff --git a/scripts/rename-package.sh b/scripts/rename-package.sh index a3d12da..66da719 100755 --- a/scripts/rename-package.sh +++ b/scripts/rename-package.sh @@ -32,6 +32,12 @@ case "$ARCH" in ;; esac +if [ -z ${BUILD_WITHOUT_QUIC+x} ]; then + QUIC="-quic"; +else + QUIC="" +fi + VSN="$(grep -E ".+vsn.+" _build/emqtt_bench/lib/emqtt_bench/ebin/emqtt_bench.app | cut -d '"' -f2)" BASE=$(find ./_build/emqtt_bench/rel/emqtt_bench -name "*.tar.gz" | tail -1) -cp "$BASE" "./emqtt-bench-${VSN}-${SYSTEM}-${ARCH}.tar.gz" +cp "$BASE" "./emqtt-bench-${VSN}-${SYSTEM}-${ARCH}${QUIC}.tar.gz" diff --git a/src/emqtt_bench.erl b/src/emqtt_bench.erl index f74f873..30d6cad 100644 --- a/src/emqtt_bench.erl +++ b/src/emqtt_bench.erl @@ -27,6 +27,8 @@ -define(PUB_OPTS, [{help, undefined, "help", boolean, "help information"}, + {dist, $d, "dist", boolean, + "enable distribution port"}, {host, $h, "host", {string, "localhost"}, "mqtt server hostname or IP address"}, {port, $p, "port", {integer, 1883}, @@ -81,6 +83,8 @@ -define(SUB_OPTS, [{help, undefined, "help", boolean, "help information"}, + {dist, $d, "dist", boolean, + "enable distribution port"}, {host, $h, "host", {string, "localhost"}, "mqtt server hostname or IP address"}, {port, $p, "port", {integer, 1883}, @@ -125,6 +129,8 @@ -define(CONN_OPTS, [ {help, undefined, "help", boolean, "help information"}, + {dist, $d, "dist", boolean, + "enable distribution port"}, {host, $h, "host", {string, "localhost"}, "mqtt server hostname or IP address"}, {port, $p, "port", {integer, 1883}, @@ -266,7 +272,7 @@ start(PubSub, Opts) -> prepare(Opts) -> Sname = list_to_atom(lists:flatten(io_lib:format("~p-~p", [?MODULE, rand:uniform(1000)]))), - net_kernel:start([Sname, shortnames]), + proplists:get_bool(dist, Opts) andalso net_kernel:start([Sname, shortnames]), case proplists:get_bool(quic, Opts) of true -> maybe_start_quicer() orelse error({quic, not_supp_or_disabled}); _ ->