Skip to content

Commit

Permalink
Load test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kalta committed Jul 24, 2014
1 parent ede029a commit 0c7f313
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 39 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ clean: clean-docs clean-logs
rm -f erl_crash.dump

clean-logs:
rm -rf log
rm -rf samples/nksip_loadtest/log
rm -rf samples/nksip_pbx/log
rm -rf samples/nksip_tutorial/log
rm -rf log/*
rm -rf samples/nksip_loadtest/log/*
rm -rf samples/nksip_pbx/log/*
rm -rf samples/nksip_tutorial/log/*

docs: clean-docs
@$(REBAR) doc skip_deps=true
Expand Down Expand Up @@ -47,15 +47,15 @@ dialyze: app
-Werror_handling #-Wunmatched_returns -Wrace_conditions -Wunderspecs

shell:
erl -config priv/app.config -args_file priv/vm.args -s reloader
erl -config priv/app.config -args_file priv/vm.args

tutorial:
erl -config samples/nksip_tutorial/priv/app.config \
-args_file samples/nksip_tutorial/priv/vm.args

loadtest: app
erl -config samples/nksip_loadtest/priv/app.config \
-args_file samples/nksip_loadtest/priv/vm.args -s nksip_loadtest -s reloader
-args_file samples/nksip_loadtest/priv/vm.args -s nksip_loadtest

pbx: app
erl -config samples/nksip_pbx/priv/app.config \
Expand Down
1 change: 1 addition & 0 deletions samples/nksip_loadtest/priv/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
{level, info}
]}
]},
{error_logger_redirect, false},
{colors, [
{debug, "\e[0;38m" },
{info, "\e[0;32m" },
Expand Down
45 changes: 12 additions & 33 deletions samples/nksip_loadtest/src/nksip_loadtest.erl
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,10 @@ full(Opts) ->
nksip_loadtest_lib:start_server(),

Opts1 = [{messages, Messages}, {clients, Clients}|Opts],
only_uas_register_stateless(Opts1),
only_uas_register_stateful(Opts1),
only_uas_register(Opts1),
only_uas_call(Opts1),

nksip_loadtest_lib:start_clients(Clients),
register_stateless([no_auto_start|Opts1]),
register_stateful([no_auto_start|Opts1]),
register([no_auto_start|Opts1]),
call([no_auto_start|Opts1]),
nksip_loadtest_lib:stop_clients(Clients),
ok.
Expand All @@ -70,25 +67,16 @@ full(Opts) ->
% Only UAS set of tests use the "raw" version of the load suite, using raw
% packets as UAC, with low overhead. UDP can't be used this way.

%% @private
only_uas_register_stateless(Opts) ->
% Raw versions don't retransmit, so UDP will have packet loss
% {_, P1, R1} = launch([raw, register, stateless|Opts1]),
% io:format("UAS REGISTER Stateless UDP (~p% ok): ~p req/sec\n\n", [P1, R1]),
{_, P2, R2} = launch([raw, register, stateless, tcp|Opts]),
io:format("UAS REGISTER Stateless TCP (~p% ok): ~p req/sec\n\n", [P2, R2]),
{_, P3, R3} = launch([raw, register, stateless, tls|Opts]),
io:format("UAS REGISTER Stateless TLS (~p% ok): ~p req/sec\n\n\n\n", [P3, R3]).


%% @private
only_uas_register_stateful(Opts) ->
only_uas_register(Opts) ->
% Raw versions don't retransmit, so UDP will have packet loss
% {_, P1, R1} = launch([raw, register|Opts]),
% io:format("UAS REGISTER Statefull UDP (~p% ok): ~p req/sec\n\n", [P1, R1]),
% io:format("UAS REGISTER UDP (~p% ok): ~p req/sec\n\n", [P1, R1]),
{_, P2, R2} = launch([raw, register, tcp|Opts]),
io:format("UAS REGISTER Statefull TCP (~p% ok): ~p req/sec\n\n", [P2, R2]),
io:format("UAS REGISTER TCP (~p% ok): ~p req/sec\n\n", [P2, R2]),
{_, P3, R3} = launch([raw, register, tls|Opts]),
io:format("UAS REGISTER Statefull TLS (~p% ok): ~p req/sec\n\n\n\n", [P3, R3]).
io:format("UAS REGISTER TLS (~p% ok): ~p req/sec\n\n\n\n", [P3, R3]).


%% @private
Expand All @@ -103,24 +91,15 @@ only_uas_call(Opts) ->

% Full versions set of tests use UAC generation and UAS response


%% @private
register_stateless(Opts) ->
{_, P4, R4} = launch([register, stateless|Opts]),
io:format("UAC+UAS REGISTER Stateless UDP (~p% ok): ~p req/sec\n\n", [P4, R4]),
{_, P5, R5} = launch([register, stateless, tcp|Opts]),
io:format("UAC+UAS REGISTER Stateless TCP (~p% ok): ~p req/sec\n\n", [P5, R5]),
{_, P6, R6} = launch([register, stateless, tls|Opts]),
io:format("UAC+UAS REGISTER Stateless TLS (~p% ok): ~p req/sec\n\n\n\n", [P6, R6]).


%% @private
register_stateful(Opts) ->
register(Opts) ->
{_, P4, R4} = launch([register|Opts]),
io:format("UAC+UAS REGISTER Statefull UDP (~p% ok): ~p req/sec\n\n", [P4, R4]),
io:format("UAC+UAS REGISTER UDP (~p% ok): ~p req/sec\n\n", [P4, R4]),
{_, P5, R5} = launch([register, tcp|Opts]),
io:format("UAC+UAS REGISTER Statefull TCP (~p% ok): ~p req/sec\n\n", [P5, R5]),
io:format("UAC+UAS REGISTER TCP (~p% ok): ~p req/sec\n\n", [P5, R5]),
{_, P6, R6} = launch([register, tls|Opts]),
io:format("UAC+UAS REGISTER Statefull TLS (~p% ok): ~p req/sec\n\n\n\n", [P6, R6]).
io:format("UAC+UAS REGISTER TLS (~p% ok): ~p req/sec\n\n\n\n", [P6, R6]).


%% @private
Expand Down

0 comments on commit 0c7f313

Please sign in to comment.