Use log at random

Easy way to sample frequent things - especially when they'r ein ocverag
equeries
This commit is contained in:
martinsumner 2017-03-06 10:34:56 +00:00
parent 94a39e4c4d
commit eb6f668fcd
3 changed files with 11 additions and 4 deletions

View file

@ -9,6 +9,7 @@
-export([log/2,
log_timer/3,
log_randomtimer/4,
put_timing/4,
head_timing/4,
get_timing/3,
@ -349,6 +350,14 @@ log_timer(LogReference, Subs, StartTime) ->
ok
end.
log_randomtimer(LogReference, Subs, StartTime, RandomProb) ->
case random:uniform() < RandomProb of
true ->
log_timer(LogReference, Subs, StartTime);
false ->
ok
end.
%% Make a log of put timings split out by actor - one log for every
%% PUT_LOGPOINT puts