aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/examples/httpd_load_test
diff options
context:
space:
mode:
authorErland Schönbeck <[email protected]>2015-03-05 13:37:16 +0100
committerRickard Green <[email protected]>2015-03-20 15:28:54 +0100
commit1132117b38cfe33e770a0d5b1a782d48667427c4 (patch)
treec40c3da27e2f10a3c50cd5a2b4dc8d9db03aa08b /lib/inets/examples/httpd_load_test
parent403fe576cd71bf32c7e42b782bf3181d809bbc88 (diff)
downloadotp-1132117b38cfe33e770a0d5b1a782d48667427c4.tar.gz
otp-1132117b38cfe33e770a0d5b1a782d48667427c4.tar.bz2
otp-1132117b38cfe33e770a0d5b1a782d48667427c4.zip
Use new time API and be back-compatible in inets
Remove unused functions and removed redundant test
Diffstat (limited to 'lib/inets/examples/httpd_load_test')
-rw-r--r--lib/inets/examples/httpd_load_test/hdlt_random_html.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/inets/examples/httpd_load_test/hdlt_random_html.erl b/lib/inets/examples/httpd_load_test/hdlt_random_html.erl
index e3a572c61f..0024284054 100644
--- a/lib/inets/examples/httpd_load_test/hdlt_random_html.erl
+++ b/lib/inets/examples/httpd_load_test/hdlt_random_html.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -48,7 +48,15 @@ stop() ->
".
content(WorkSim, SzSim) ->
- {A, B, C} = now(),
+ %% Adapt to OTP 18 erlang time API and be back-compatible
+ {A, B, C} = try
+ {erlang:phash2([node()]),
+ erlang:monotonic_time(),
+ erlang:unique_integer()}
+ catch
+ error:undef ->
+ erlang:now()
+ end,
random:seed(A, B, C),
lists:sort([random:uniform(X) || X <- lists:seq(1, WorkSim)]),
lists:flatten(lists:duplicate(SzSim, "Dummy data ")).