pub struct CountingVfs<V> { /* private fields */ }Expand description
Byte/call-counting decorator used by deterministic open-cost gates.
Implementations§
Source§impl<V> CountingVfs<V>
impl<V> CountingVfs<V>
Sourcepub fn with_read_path_filter(self, path: impl Into<PathBuf>) -> Self
pub fn with_read_path_filter(self, path: impl Into<PathBuf>) -> Self
Counts successful reads of one exact path separately from global reads.
Sourcepub fn open_calls(&self) -> u64
pub fn open_calls(&self) -> u64
Returns observed open calls.
Sourcepub fn open_for_map_calls(&self) -> u64
pub fn open_for_map_calls(&self) -> u64
Returns observed mapping-file open calls.
Sourcepub fn read_calls(&self) -> u64
pub fn read_calls(&self) -> u64
Returns observed read calls.
Sourcepub fn filtered_read_calls(&self) -> u64
pub fn filtered_read_calls(&self) -> u64
Returns successful reads matching the configured exact path.
Sourcepub fn read_bytes(&self) -> u64
pub fn read_bytes(&self) -> u64
Returns exact bytes returned by reads.
Sourcepub fn segment_bytes_read(&self) -> u64
pub fn segment_bytes_read(&self) -> u64
Returns exact bytes read from immutable segment paths.
Sourcepub fn write_calls(&self) -> u64
pub fn write_calls(&self) -> u64
Returns observed whole-file write calls.
Sourcepub fn bytes_written(&self) -> u64
pub fn bytes_written(&self) -> u64
Returns exact bytes supplied to successful whole-file writes.
Sourcepub fn append_calls(&self) -> u64
pub fn append_calls(&self) -> u64
Returns observed successful handle append calls.
Sourcepub fn bytes_appended(&self) -> u64
pub fn bytes_appended(&self) -> u64
Returns exact bytes supplied to successful handle appends.
Sourcepub fn rename_calls(&self) -> u64
pub fn rename_calls(&self) -> u64
Returns observed successful rename calls.
Sourcepub fn delete_calls(&self) -> u64
pub fn delete_calls(&self) -> u64
Returns observed successful delete calls.
Sourcepub fn enumerate_calls(&self) -> u64
pub fn enumerate_calls(&self) -> u64
Returns observed streaming directory-enumeration calls.
Sourcepub fn barrier_sync_calls(&self) -> u64
pub fn barrier_sync_calls(&self) -> u64
Returns path-based barrier synchronization calls.
Sourcepub fn full_sync_calls(&self) -> u64
pub fn full_sync_calls(&self) -> u64
Returns path-based full synchronization calls.
Sourcepub fn handle_barrier_sync_calls(&self) -> u64
pub fn handle_barrier_sync_calls(&self) -> u64
Returns open-handle barrier synchronization calls.
Sourcepub fn handle_full_sync_calls(&self) -> u64
pub fn handle_full_sync_calls(&self) -> u64
Returns open-handle full synchronization calls.
Trait Implementations§
Source§impl<V: Vfs> Vfs for CountingVfs<V>
impl<V: Vfs> Vfs for CountingVfs<V>
Source§fn truncate(&self, path: &Path, length: u64) -> Result<()>
fn truncate(&self, path: &Path, length: u64) -> Result<()>
Source§fn create_new(&self, path: &Path, bytes: &[u8]) -> Result<()>
fn create_new(&self, path: &Path, bytes: &[u8]) -> Result<()>
Source§fn create_directory(&self, path: &Path) -> Result<()>
fn create_directory(&self, path: &Path) -> Result<()>
AlreadyExists; no ancestor is adopted implicitly.Source§fn remove_directory(&self, path: &Path) -> Result<()>
fn remove_directory(&self, path: &Path) -> Result<()>
Source§fn ensure_directory(&self, path: &Path, create: bool) -> Result<bool>
fn ensure_directory(&self, path: &Path, create: bool) -> Result<bool>
Source§fn open(&self, path: &Path) -> Result<u64>
fn open(&self, path: &Path) -> Result<u64>
Source§fn open_for_map(&self, path: &Path) -> Result<File>
fn open_for_map(&self, path: &Path) -> Result<File>
Source§fn read_range(&self, path: &Path, offset: u64, length: usize) -> Result<Vec<u8>>
fn read_range(&self, path: &Path, offset: u64, length: usize) -> Result<Vec<u8>>
length bytes beginning at offset.