diff options
author | Linus Nordberg <linus@nordu.net> | 2017-07-06 17:34:48 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2017-07-06 17:34:48 +0200 |
commit | 05235680257a54f112c44c7854b3afe8300acd40 (patch) | |
tree | 25fe5447ec40e8bd59170241bcbd107f2e56f45d /src/bench.erl | |
parent | 0d7c7bb15f449656e35801dac5ba410f16261c6f (diff) | |
parent | df2441c6315de4b245e1faf5b72517c5199fe179 (diff) |
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. |