Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-j97 committed Mar 19, 2024
1 parent 53f5286 commit 649cdc7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/segment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl Segment {
false
}

/// Returns the amount of items (dead or alive) in the segment
/// Returns the amount of items in the segment
pub fn len(&self) -> u64 {
self.stats.item_count
}
Expand Down
13 changes: 13 additions & 0 deletions src/value_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,19 @@ impl ValueLog {
.sum::<u64>()
}

/// Returns the amount of stale items
///
/// This value may not be fresh, as it is only set after running [`ValueLog::refresh_stats`].
#[must_use]
pub fn stale_items_count(&self) -> u64 {
self.segments
.read()
.expect("lock is poisoned")
.values()
.map(|x| x.stats.get_stale_items())
.sum::<u64>()
}

/// Returns the percent of dead bytes in the value log
///
/// This value may not be fresh, as it is only set after running [`ValueLog::refresh_stats`].
Expand Down

0 comments on commit 649cdc7

Please sign in to comment.