Skip to main content

fsync_probe

Function fsync_probe 

Source
fn fsync_probe(dir: &Path, page_size: Option<u64>) -> Result<FsyncStats>
Expand description

Writes and syncs a scratch file inside dir, sized to page_size (SQLite’s own page size, or 4096 if unknown), and returns fsync latency stats. The file is written and synced once before sampling to preallocate its page; each sample then seeks back to the start and overwrites in place, mirroring SQLite’s steady-state writes rather than growing the file every iteration, so that sync_data (fdatasync on Linux) need not flush changed metadata such as file size.