Missed log line added back

.. and covered in test
This commit is contained in:
Martin Sumner 2017-12-04 15:26:01 +00:00
parent fea87c21ec
commit bb39498ec5
3 changed files with 26 additions and 1 deletions

View file

@ -54,6 +54,9 @@ crossbucket_aae(_Config) ->
fun testutil:generate_smallobjects/2,
40000),
%% Check all the objects are found - used to trigger HEAD performance log
ok = testutil:checkhead_forlist(Bookie2, lists:nth(1, CLs)),
% Start a new store, and load the same objects (except fot the original
% test object) into this store

View file

@ -11,6 +11,7 @@
reset_filestructure/0,
reset_filestructure/1,
check_bucket_stats/2,
checkhead_forlist/2,
check_forlist/2,
check_forlist/3,
check_formissinglist/2,
@ -266,6 +267,25 @@ check_forlist(Bookie, ChkList, Log) ->
io:format("Fetch check took ~w microseconds checking list of length ~w~n",
[timer:now_diff(os:timestamp(), SW), length(ChkList)]).
checkhead_forlist(Bookie, ChkList) ->
SW = os:timestamp(),
lists:foreach(fun({_RN, Obj, _Spc}) ->
R = book_riakhead(Bookie,
Obj#r_object.bucket,
Obj#r_object.key),
true = case R of
{ok, _Head} ->
true;
not_found ->
io:format("Object not found for key ~s~n",
[Obj#r_object.key]),
error
end
end,
ChkList),
io:format("Head check took ~w microseconds checking list of length ~w~n",
[timer:now_diff(os:timestamp(), SW), length(ChkList)]).
check_formissinglist(Bookie, ChkList) ->
SW = os:timestamp(),
lists:foreach(fun({_RN, Obj, _Spc}) ->