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

virtualization: add new builtin command to print hydration level #659

Merged
merged 3 commits into from
Jun 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions wt-status.c
Original file line number Diff line number Diff line change
Expand Up @@ -2560,6 +2560,36 @@ void wt_status_print(struct wt_status *s)
s->untracked.nr);
trace2_data_intmax("status", s->repo, "count/ignored", s->ignored.nr);

switch (s->state.sparse_checkout_percentage) {
case SPARSE_CHECKOUT_DISABLED:
break;
case SPARSE_CHECKOUT_SPARSE_INDEX:
/*
* Log just the observed size of the sparse-index.
*
* When sparse-index is enabled we can have
* sparse-directory entries in addition to individual
* sparse-file entries, so we don't know the complete
* size of the index. And we do not want to force
* expand it just to emit some telemetry data. So we
* cannot report a percentage for the space savings.
*
* It is possible that if the telemetry data is
* aggregated, someone will have a good estimate for
* the size of a fully populated index and can compute
* a percentage after the fact.
*/
trace2_data_intmax("status", s->repo,
"sparse-index/size",
s->repo->index->cache_nr);
break;
default:
trace2_data_intmax("status", s->repo,
"sparse-checkout/percentage",
s->state.sparse_checkout_percentage);
break;
}

trace2_region_enter("status", "print", s->repo);

switch (s->status_format) {
Expand Down
Loading