Skip to content

Commit 56d848e

Browse files
committed
extend book status report ct case
1 parent 11e30b9 commit 56d848e

1 file changed

Lines changed: 52 additions & 25 deletions

File tree

test/end_to_end/basic_SUITE.erl

Lines changed: 52 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@
2121

2222
all() ->
2323
[
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
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
3939
].
4040

4141
init_per_suite(Config) ->
@@ -52,12 +52,21 @@ bookie_status_report(_Config) ->
5252
{root_path, RootPath},
5353
{sync_strategy, testutil:sync_strategy()},
5454
{log_level, info},
55+
{stats_percentage, 100},
5556
{forced_logs, []}
5657
],
5758
{ok, Bookie} = leveled_bookie:book_start(StartOpts),
5859

5960
InitialReport =
6061
#{
62+
ledger_cache_size => undefined,
63+
n_active_journal_files => undefined,
64+
level_files_count => undefined,
65+
penciller_inmem_cache_size => undefined,
66+
penciller_work_backlog_status => undefined,
67+
penciller_last_merge_time => undefined,
68+
journal_last_compaction_time => undefined,
69+
journal_last_compaction_result => undefined,
6170
fetch_count_by_level =>
6271
#{
6372
not_found => #{count => 0, time => 0},
@@ -68,26 +77,44 @@ bookie_status_report(_Config) ->
6877
'2' => #{count => 0, time => 0},
6978
'3' => #{count => 0, time => 0}
7079
},
71-
get_body_time => 0,
7280
get_sample_count => 0,
73-
head_rsp_time => 0,
81+
get_body_time => 0,
7482
head_sample_count => 0,
83+
head_rsp_time => 0,
84+
put_sample_count => 0,
85+
put_prep_time => 0,
7586
put_ink_time => 0,
7687
put_mem_time => 0,
77-
put_prep_time => 0,
78-
put_sample_count => 0
88+
avg_compaction_score => undefined
7989
},
8090
InitialReport = leveled_bookie:book_status(Bookie),
8191

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),
92+
{TObj, TSpec} = testutil:generate_testobject(),
93+
ok = testutil:book_riakput(Bookie, TObj, TSpec),
94+
95+
Rep1 = leveled_bookie:book_status(Bookie),
96+
1 = maps:get(ledger_cache_size, Rep1),
97+
1 = maps:get(put_sample_count, Rep1),
98+
GoodPutPrepTime = 10000,
99+
GoodPutInkTime = 10000,
100+
GoodPutMemTime = 100,
101+
within_range(1, GoodPutPrepTime, maps:get(put_prep_time, Rep1)),
102+
within_range(1, GoodPutInkTime, maps:get(put_ink_time, Rep1)),
103+
within_range(1, GoodPutMemTime, maps:get(put_mem_time, Rep1)),
104+
105+
{r_object, TBkt, TKey, _, _, _, _} = TObj,
106+
{ok, _} = testutil:book_riakget(Bookie, TBkt, TKey),
107+
Rep2 = leveled_bookie:book_status(Bookie),
108+
1 = maps:get(get_sample_count, Rep2),
109+
GoodGetBodyTime = 500,
110+
within_range(1, GoodGetBodyTime, maps:get(get_body_time, Rep2)),
88111

89112
ok = leveled_bookie:book_destroy(Bookie).
90113

114+
within_range(Min, Max, V) ->
115+
true = Min =< V,
116+
true = Max >= V.
117+
91118
simple_put_fetch_head_delete(_Config) ->
92119
io:format("simple test with info and no forced logs~n"),
93120
simple_test_withlog(info, []),

0 commit comments

Comments
 (0)