-
Notifications
You must be signed in to change notification settings - Fork 2
WIP leveled_bookie:status/1 #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: openriak-3.4
Are you sure you want to change the base?
WIP leveled_bookie:status/1 #17
Conversation
* avg/best_compaction_score * level_files_count * penciller_inmem_cache_size
|
Marking as WIP pending work on the last item ("Mean level for recent fetches"). |
|
Can we add a test to the It would be good to verify that the results returned are as expected. Some may just need to be range checked, but you can get the PIDs of the Inker/Penciller via Obviously fails the coverage check at the moment as There are tests in basic_SUITE that prompt journal compaction, so you cna follow the pattern to check results are expected after a compaction. |
|
The PUT will call I do think it should try a number of operations, so that we can check all the values change to the right order of magnitude. There are a lot of load functions, or you can add a fetch and validation of the book status into one of the other tests. Also, what happened to reporting the journal compaction scores and results? |
|
|
||
| -spec book_status(pid()) -> proplists:proplist(). | ||
| %% @doc | ||
| %% Return a proplist conteaining the following items: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
containing
| book_headstatus(Pid) -> | ||
| gen_server:call(Pid, head_status, infinity). | ||
|
|
||
| -spec book_status(pid()) -> proplists:proplist(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A proplist or a map?
| put_mem_time => PT#bookie_put_timings.mem_time, | ||
| fetch_count_by_level => FCL | ||
| }. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there has been no compaction, is there no report on compaction? Would it not be better to consistently sure all keys exist, but have them set to a default value when they haven't occurred.
| code_change(_OldVsn, State, _Extra) -> | ||
| {ok, State}. | ||
|
|
||
| enriched_bookie_status(#state{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dialyzer spec required.
By default, in leveled, we try to avoid passing the LoopState to functions outside of the standard handle_call/caast/info functions. I would probably do this within the handle_call rather than have it as a separate function - as it is just a function based on knowledge of #state, and there's not separate testing of the function. [in this case there would be no need for a dialyzer spec]
This implements martinsumner#478.
When called here, it returns a map containing reportable items described in the issue above.
Not all items can be available at the time of calling, in which case the backend_status will not include the corresponding keys.
In riak_control, the results will show as follows:

