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

Consider adding the stats of region data size #4071

Closed
WenyXu opened this issue May 30, 2024 · 2 comments
Closed

Consider adding the stats of region data size #4071

WenyXu opened this issue May 30, 2024 · 2 comments
Labels
good first issue Good for newcomers

Comments

@WenyXu
Copy link
Member

WenyXu commented May 30, 2024

          Yep, it only contains the manifest size, can it include the data size too?

Originally posted by @killme2008 in #4070 (comment)

@evenyag
Copy link
Contributor

evenyag commented May 30, 2024

We can collect the file sizes from the SstVersion

/// Returns SST files'space occupied in current version.
pub(crate) fn sst_usage(&self) -> u64 {
self.levels
.iter()
.map(|level_meta| {
level_meta
.files
.values()
.map(|file_handle| {
let meta = file_handle.meta_ref();
meta.file_size + meta.index_file_size
})
.sum::<u64>()
})
.sum()
}

@killme2008 killme2008 added the good first issue Good for newcomers label Jun 24, 2024
@killme2008
Copy link
Contributor

Looks like already exists:

pub struct RegionUsage {

pub fn get_region_usage(&self, region_id: RegionId) -> Result<RegionUsage> {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants