use std::ops::AddAssign;
#[derive(Default, Debug)]
pub struct BucketStats {
pub branch_page_n: usize, pub branch_overflow_n: usize, pub leaf_page_n: usize, pub leaf_overflow_n: usize,
pub key_n: usize, pub depth: usize,
pub branch_alloc: usize, pub branch_in_use: usize, pub leaf_alloc: usize, pub leaf_in_use: usize,
pub bucket_n: usize, pub inline_bucket_n: usize, pub inline_bucket_in_use: usize, }
impl AddAssign for BucketStats {
fn add_assign(&mut self, other: BucketStats) {
self.branch_page_n += other.branch_page_n;
self.branch_overflow_n += other.branch_overflow_n;
self.leaf_page_n += other.leaf_page_n;
self.leaf_overflow_n += other.leaf_overflow_n;
self.key_n += other.key_n;
if self.depth < other.depth {
self.depth = other.depth;
};
self.branch_alloc += other.branch_alloc;
self.branch_in_use += other.branch_in_use;
self.leaf_alloc += other.leaf_alloc;
self.leaf_in_use += other.leaf_in_use;
self.bucket_n += other.bucket_n;
self.inline_bucket_n += other.inline_bucket_n;
self.inline_bucket_in_use += other.inline_bucket_in_use;
}
}