mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
Switch to a single view indicating current usage
This commit is contained in:
parent
256538ccb9
commit
cc79cd0b04
2 changed files with 20 additions and 46 deletions
|
@ -133,6 +133,14 @@ impl MemoryStats {
|
|||
bytes_reallocated: self.bytes_reallocated.checked_sub(other.bytes_reallocated)?,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn usage(&self) -> isize {
|
||||
(self.bytes_allocated - self.bytes_deallocated) as isize + self.bytes_reallocated
|
||||
}
|
||||
|
||||
pub fn operations(&self) -> usize {
|
||||
self.allocations + self.deallocations + self.reallocations
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue