Skip to content

Commit acd0b57

Browse files
committed
ct test for bookie status report wip
1 parent 447a066 commit acd0b57

1 file changed

Lines changed: 60 additions & 15 deletions

File tree

test/end_to_end/basic_SUITE.erl

Lines changed: 60 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,27 @@
1515
bigsst_littlesst/1,
1616
safereaderror_startup/1,
1717
remove_journal_test/1,
18-
bigpcl_bucketlist/1
18+
bigpcl_bucketlist/1,
19+
bookie_status_report/1
1920
]).
2021

2122
all() ->
2223
[
23-
simple_put_fetch_head_delete,
24-
many_put_fetch_head,
25-
journal_compaction,
26-
fetchput_snapshot,
27-
load_and_count,
28-
load_and_count_withdelete,
29-
space_clear_ondelete,
30-
is_empty_test,
31-
many_put_fetch_switchcompression,
32-
bigjournal_littlejournal,
33-
bigsst_littlesst,
34-
safereaderror_startup,
35-
remove_journal_test,
36-
bigpcl_bucketlist
24+
bookie_status_report
25+
%% simple_put_fetch_head_delete,
26+
%% many_put_fetch_head,
27+
%% journal_compaction,
28+
%% fetchput_snapshot,
29+
%% load_and_count,
30+
%% load_and_count_withdelete,
31+
%% space_clear_ondelete,
32+
%% is_empty_test,
33+
%% many_put_fetch_switchcompression,
34+
%% bigjournal_littlejournal,
35+
%% bigsst_littlesst,
36+
%% safereaderror_startup,
37+
%% remove_journal_test,
38+
%% bigpcl_bucketlist
3739
].
3840

3941
init_per_suite(Config) ->
@@ -43,6 +45,49 @@ init_per_suite(Config) ->
4345
end_per_suite(Config) ->
4446
testutil:end_per_suite(Config).
4547

48+
bookie_status_report(_Config) ->
49+
RootPath = testutil:reset_filestructure(),
50+
StartOpts =
51+
[
52+
{root_path, RootPath},
53+
{sync_strategy, testutil:sync_strategy()},
54+
{log_level, info},
55+
{forced_logs, []}
56+
],
57+
{ok, Bookie} = leveled_bookie:book_start(StartOpts),
58+
59+
InitialReport =
60+
#{
61+
fetch_count_by_level =>
62+
#{
63+
not_found => #{count => 0, time => 0},
64+
mem => #{count => 0, time => 0},
65+
lower => #{count => 0, time => 0},
66+
'0' => #{count => 0, time => 0},
67+
'1' => #{count => 0, time => 0},
68+
'2' => #{count => 0, time => 0},
69+
'3' => #{count => 0, time => 0}
70+
},
71+
get_body_time => 0,
72+
get_sample_count => 0,
73+
head_rsp_time => 0,
74+
head_sample_count => 0,
75+
put_ink_time => 0,
76+
put_mem_time => 0,
77+
put_prep_time => 0,
78+
put_sample_count => 0
79+
},
80+
InitialReport = leveled_bookie:book_status(Bookie),
81+
82+
{TestObject, TestSpec} = testutil:generate_testobject(),
83+
ok = testutil:book_riakput(Bookie, TestObject, TestSpec),
84+
85+
ReportAfterOnePut =
86+
maps:merge(#{ledger_cache_size => 1}, InitialReport),
87+
ReportAfterOnePut = leveled_bookie:book_status(Bookie),
88+
89+
ok = leveled_bookie:book_destroy(Bookie).
90+
4691
simple_put_fetch_head_delete(_Config) ->
4792
io:format("simple test with info and no forced logs~n"),
4893
simple_test_withlog(info, []),

0 commit comments

Comments
 (0)