Dumb test
Can't test for slow not_present outside of simple unit test ... will be very rare event
This commit is contained in:
parent
19534122a2
commit
4e6c22d7e6
1 changed files with 7 additions and 2 deletions
|
@ -797,8 +797,11 @@ timed_sst_get(PID, Key, Hash) ->
|
||||||
SW = os:timestamp(),
|
SW = os:timestamp(),
|
||||||
R = leveled_sst:sst_get(PID, Key, Hash),
|
R = leveled_sst:sst_get(PID, Key, Hash),
|
||||||
T0 = timer:now_diff(os:timestamp(), SW),
|
T0 = timer:now_diff(os:timestamp(), SW),
|
||||||
|
log_slowfetch(T0, R, PID, ?SLOW_FETCH).
|
||||||
|
|
||||||
|
log_slowfetch(T0, R, PID, FetchTolerance) ->
|
||||||
case {T0, R} of
|
case {T0, R} of
|
||||||
{T, R} when T < ?SLOW_FETCH ->
|
{T, R} when T < FetchTolerance ->
|
||||||
R;
|
R;
|
||||||
{T, not_present} ->
|
{T, not_present} ->
|
||||||
leveled_log:log("PC016", [PID, T, not_present]),
|
leveled_log:log("PC016", [PID, T, not_present]),
|
||||||
|
@ -807,7 +810,6 @@ timed_sst_get(PID, Key, Hash) ->
|
||||||
leveled_log:log("PC016", [PID, T, found]),
|
leveled_log:log("PC016", [PID, T, found]),
|
||||||
R
|
R
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
compare_to_sqn(Obj, SQN) ->
|
compare_to_sqn(Obj, SQN) ->
|
||||||
case Obj of
|
case Obj of
|
||||||
|
@ -1418,6 +1420,9 @@ create_file_test() ->
|
||||||
{ok, Bin} = file:read_file("../test/new_file.sst.discarded"),
|
{ok, Bin} = file:read_file("../test/new_file.sst.discarded"),
|
||||||
?assertMatch("hello", binary_to_term(Bin)).
|
?assertMatch("hello", binary_to_term(Bin)).
|
||||||
|
|
||||||
|
slow_fetch_test() ->
|
||||||
|
?assertMatch(not_present, log_slowfetch(2, not_present, "fake", 1)).
|
||||||
|
|
||||||
checkready(Pid) ->
|
checkready(Pid) ->
|
||||||
try
|
try
|
||||||
leveled_sst:sst_checkready(Pid)
|
leveled_sst:sst_checkready(Pid)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue