pub struct PoolStats {
pub hits: u64,
pub misses: u64,
pub evictions: u64,
pub frames_total: usize,
pub peak_pins: u32,
pub sync_data_calls: u64,
pub sync_full_calls: u64,
pub dirty_pages_flushed: u64,
}Fields§
§hits: u64§misses: u64§evictions: u64§frames_total: usizeTotal frames the pool reserved at open – its CAPACITY, not its residency. The region is allocated once and never grown, so this is the anonymous memory the pool holds from open onward whether or not the frames are populated.
It was called frames_used, and that name cost a reviewer a false
finding: 170 MB “used” against a 5 MB database reads as an accounting
bug rather than as a preallocated arena working exactly as designed. A
number that invites a wrong inference is a reporting defect even when
the arithmetic is right. See also a_full_scan_pins_one_leaf_at_a_time
in btree.rs, which independently found this field cannot move and so
cannot be asserted on for any specific operation – peak_pins is the
field for that.
peak_pins: u32§sync_data_calls: u64Barriers actually placed by flush_all, counted at the point they are
issued rather than where they are chosen. Asserting on what a caller
like Store::checkpoint passed would only prove it passed
something – these live here because this is where the syscall
actually happens, so a caller that silently ignored its own argument
could not still make the test pass.
sync_full_calls: u64§dirty_pages_flushed: u64Dirty frames written by flush_all (monotonic since pool construction).