aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2018-03-22 10:02:30 +0100
committerHans Bolinder <[email protected]>2018-03-22 10:02:30 +0100
commita59429dcf6f69054e5e82783f7adf8a03c11fcc7 (patch)
tree5c14dfa052ef89e08e6d75d2d7fe44e9cc7b2168
parent5baf6948b10a47b9535750798898ed6b84c27039 (diff)
parent19f321078ba82968ccda000b73c2c23ffb249086 (diff)
downloadotp-a59429dcf6f69054e5e82783f7adf8a03c11fcc7.tar.gz
otp-a59429dcf6f69054e5e82783f7adf8a03c11fcc7.tar.bz2
otp-a59429dcf6f69054e5e82783f7adf8a03c11fcc7.zip
Merge remote-tracking branch 'origin/hasse/stdlib/fix_benchmark'
* origin/hasse/stdlib/fix_benchmark: stdlib: Make benchmarks more robust
-rw-r--r--lib/stdlib/test/stdlib_bench_SUITE.erl16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/stdlib/test/stdlib_bench_SUITE.erl b/lib/stdlib/test/stdlib_bench_SUITE.erl
index 294898a932..2364e8376f 100644
--- a/lib/stdlib/test/stdlib_bench_SUITE.erl
+++ b/lib/stdlib/test/stdlib_bench_SUITE.erl
@@ -348,12 +348,16 @@ do_tests(Test, ParamSet, Config) ->
{Parallelism, Message} = bench_params(ParamSet),
Fun = create_clients(Message, ServerMod, Client, Parallelism),
{TotalLoops, AllPidTime} = run_test(Fun),
- PerSecond = ?CALLS_PER_LOOP * round((1000 * TotalLoops) / AllPidTime),
- ct_event:notify(
- #event{
- name = benchmark_data,
- data = [{suite,BenchmarkSuite},{value,PerSecond}]}),
- PerSecond.
+ try ?CALLS_PER_LOOP * round((1000 * TotalLoops) / AllPidTime) of
+ PerSecond ->
+ ct_event:notify(
+ #event{
+ name = benchmark_data,
+ data = [{suite,BenchmarkSuite},{value,PerSecond}]}),
+ PerSecond
+ catch error:badarith ->
+ "Time measurement is not working"
+ end.
-define(COUNTER, n).