diff options
| author | Magnus Ahltorp <map@kth.se> | 2017-03-17 01:24:44 +0100 |
|---|---|---|
| committer | Magnus Ahltorp <map@kth.se> | 2017-03-17 01:46:32 +0100 |
| commit | 2b7dda1f9519b2b5d722ee68fa7da596ae9b0e4c (patch) | |
| tree | 598b02751d5273c93adf392587006cd346fcdda9 /src/bench.erl | |
| parent | 28e24e48dcd6203f2c24e28f15aec8167697c9c0 (diff) | |
Added benchmark reporting.benchreport
Diffstat (limited to 'src/bench.erl')
| -rw-r--r-- | src/bench.erl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/bench.erl b/src/bench.erl new file mode 100644 index 0000000..06e4777 --- /dev/null +++ b/src/bench.erl @@ -0,0 +1,18 @@ +%%% Copyright (c) 2017, NORDUnet A/S. +%%% See LICENSE for licensing information. + +-module(bench). + +-export([timingpoint/3]). + +timingpoint(Service, Target, Tag) -> + Thispoint = plop_compat:monotonic_time(millisecond), + Seq = plop_compat:unique_integer([monotonic]), + case get(bench_lastpoint) of + undefined -> + statusreport:bench(Service, Target, Tag, Seq, Thispoint + plop_compat:time_offset(millisecond), null); + Lastpoint -> + statusreport:bench(Service, Target, Tag, Seq, Lastpoint + plop_compat:time_offset(millisecond), Thispoint - Lastpoint) + end, + put(bench_lastpoint, Thispoint), + ok. |
