Use log at random
Easy way to sample frequent things - especially when they'r ein ocverag equeries
This commit is contained in:
parent
94a39e4c4d
commit
eb6f668fcd
3 changed files with 11 additions and 4 deletions
|
@ -847,7 +847,7 @@ snapshot_store(State, SnapType, Query) ->
|
|||
source_penciller=State#state.penciller},
|
||||
{ok, LedgerSnapshot} = leveled_penciller:pcl_start(PCLopts),
|
||||
LedgerCache = readycache_forsnapshot(State#state.ledger_cache, Query),
|
||||
leveled_log:log_timer("B0004", [cache_size(LedgerCache)], SW),
|
||||
leveled_log:log_randomtimer("B0004", [cache_size(LedgerCache)], SW, 0.1),
|
||||
case SnapType of
|
||||
store ->
|
||||
InkerOpts = #inker_options{start_snapshot=true,
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -408,9 +408,7 @@ handle_call({fetch_keys, StartKey, EndKey, AccFun, InitAcc, MaxKeys},
|
|||
List ->
|
||||
List
|
||||
end,
|
||||
leveled_log:log_timer("P0037",
|
||||
[length(L0AsList)],
|
||||
SW),
|
||||
leveled_log:log_randomtimer("P0037", [length(L0AsList)], SW, 0.1),
|
||||
SetupFoldFun =
|
||||
fun(Level, Acc) ->
|
||||
Pointers = leveled_pmanifest:range_lookup(State#state.manifest,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue