Skip to content
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

clean up shrink candidate stat #3037

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

HaoranYi
Copy link

Problem

When selecting candidate storages for shrinking, it will be helpful to report
how many storages are selected to shrink, how many are deferred for next round,
and what's the total number of storages to begin with. This will help us to
tune the threshold of alive ratio for shrinking cut off.

The current metric is using a debug counter, seems to be obsolete and doesn't
provide the above info.

Summary of Changes

rework shrink select metrics - report select timing, selected count, deferred
count, and total count as datapoint_info.

Fixes #

@HaoranYi HaoranYi force-pushed the accounts-db/shrink_select_stat branch 2 times, most recently from a60c0d8 to 77c31c7 Compare September 30, 2024 16:59
jeffwashington
jeffwashington previously approved these changes Sep 30, 2024
Copy link

@jeffwashington jeffwashington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like it

Comment on lines 4653 to 4662
datapoint_info!(
"shrink_select",
("select_time_us", measure.as_us(), i64),
("candidates_count", candidates_count, i64),
("selected_count", shrink_slots.len(), i64),
(
"deferred_to_next_round_count",
shrink_slots_next_batch.len(),
i64
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these new datapoints go into ShrinkStats instead?

Copy link
Author

@HaoranYi HaoranYi Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not.
FWIK. ShrinkStats is more like an aggregated view from accounts-db's perspective, which aggregates all the calls to shrink and report a sum of the timing and other stats for all the shrink invocations per a period. While this datapoint is to report timing and stats from just one invocation of shrink, such as one shrink call from ABS. Thus, it can be thought of as a more detailed stats for handle_snapshot_requests-timing.shrink_time.

@HaoranYi
Copy link
Author

HaoranYi commented Oct 1, 2024

I pushed another change to move the datapoint one level up to fn shrink_candidate_slots()

@HaoranYi HaoranYi changed the title clean up shrink select stat clean up shrink candidate stat Oct 1, 2024
Copy link

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

The refactor and cleanup looks correct to me.

@HaoranYi HaoranYi merged commit 1805924 into anza-xyz:master Oct 1, 2024
40 checks passed
@HaoranYi HaoranYi deleted the accounts-db/shrink_select_stat branch October 1, 2024 21:25
ray-kast pushed a commit to abklabs/agave that referenced this pull request Nov 27, 2024
rework shrink select stat

Co-authored-by: HaoranYi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants