Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support json payload template #202

Merged
merged 16 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

{deps, [
{getopt, {git, "https://github.com/zmstone/getopt", {tag, "v1.0.2.1"}}},
{emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.11.0"}}},
{emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.13.1"}}},
{prometheus, {git, "https://github.com/emqx/prometheus.erl", {tag, "v4.10.0.2"}}},
{cowboy, "2.9.0"}
{cowboy, "2.9.0"},
{jsx, "3.1.0"}
]}.

{escript_name, emqtt_bench}.
Expand Down
13 changes: 6 additions & 7 deletions rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ IsWin32 = fun() ->
win32 =:= element(1, os:type())
end,

Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.114"}}},
Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.504"}}},

IsQuicSupp = not (IsCentos6() orelse IsWin32() orelse
false =/= os:getenv("BUILD_WITHOUT_QUIC")
Expand All @@ -25,6 +25,7 @@ Profiles = {profiles,[ {escript, []}
, getopt
, cowboy
, prometheus
, jsx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true.

json encoding with large payload is toooo slow. Took me some time to find the slowness is coming from jsx.
In my demo, or test report, I will use eterm encoding, json encoding is reserved for specific customer.

| [ quicer || IsQuicSupp ]
] }
, {overlay_vars_values, [ {runner_root_dir, "$(cd $(dirname $(readlink $0 || echo $0))/..; pwd -P)"}
Expand All @@ -34,6 +35,7 @@ Profiles = {profiles,[ {escript, []}
, {mkdir, "escript"}
, {copy, "_build/emqtt_bench/bin", "escript"}
, {copy, "bin/emqtt_bench","bin/emqtt_bench"}
, {copy, "topic_spec.json", "topic_spec.json"}
, {template,"bin/emqtt_bench","bin/emqtt_bench"}
]}
, {tar_hooks, [ "scripts/macos-sign-binaries.sh",
Expand All @@ -56,12 +58,9 @@ ExtraDeps = fun(C) ->
lists:keystore(deps, 1, C, {deps, Deps})
end,

NewConfig = [ {escript_incl_apps,
[emqtt_bench,
prometheus,
quantile_estimator,
cowboy
| [ quicer || IsQuicSupp ]
NewConfig = [ {escript_incl_apps,
[emqtt_bench |
[ quicer || IsQuicSupp ]
]}
, Profiles
| ExtraDeps(CONFIG)],
Expand Down
12 changes: 11 additions & 1 deletion src/emqtt_bench.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
{description, "Erlang MQTT v5.0 Benchmark Tool"},
{vsn, git},
{registered, []},
{applications, [kernel, stdlib, emqtt, getopt, gun, cowlib]},
{applications, [kernel,
stdlib,
emqtt,
getopt,
gun,
cowlib,
jsx,
prometheus,
quantile_estimator,
cowboy
]},
{included_applications, [cowboy, prometheus]},
{env, []},
{maintainers,["Feng Lee <[email protected]>"]},
Expand Down
Loading
Loading