pub struct CheckpointStats {
pub total_count: u64,
pub last_write_us: u64,
pub last_sync_us: u64,
pub last_total_us: u64,
pub last_wal_bytes: u64,
pub last_snapshot_bytes: u64,
pub last_files_synced: u32,
pub recent_total_us: VecDeque<u64>,
}Expand description
v7.37.13 (A1.9) — per-checkpoint instrumentation. PG-equivalent
of LogCheckpointEnd, with [PG+] percentile buckets over a
rolling window of recent checkpoints (PG just logs the latest).
All durations are microseconds. Fields below “last_*” describe
the most recent checkpoint; “total_count” counts every
successful checkpoint over the process lifetime. The
recent_total_us deque holds up to CHECKPOINT_STATS_WINDOW
total-duration samples for p50/p95/p99 computation.
Fields§
§total_count: u64Process-lifetime count of successful checkpoints. Failed (poisoned, IO error) checkpoints do NOT advance this.
last_write_us: u64Snapshot serialize + tmp+rename duration (µs).
last_sync_us: u64WAL flush_now + chunk rotation duration (µs).
last_total_us: u64End-to-end checkpoint duration (µs) = write + manifest + sync + rotate.
last_wal_bytes: u64Bytes of WAL that fell behind the marker (= WAL written during this checkpoint, roughly).
last_snapshot_bytes: u64Snapshot bytes written to disk.
last_files_synced: u32Files synced as part of the checkpoint (snapshot + manifest
- WAL marker + dir fsyncs). Approximate — counts the major disk touches, not every internal sync_data() call.
recent_total_us: VecDeque<u64>[PG+] Rolling window of last_total_us for percentile
computation. Oldest at front, newest at back; bounded at
CHECKPOINT_STATS_WINDOW.
Implementations§
Source§impl CheckpointStats
impl CheckpointStats
Sourcepub fn percentiles(&self) -> (u64, u64, u64)
pub fn percentiles(&self) -> (u64, u64, u64)
[PG+] p50 / p95 / p99 of recent_total_us. Returns
(p50, p95, p99) in microseconds. If the window has fewer
than 3 samples each value is the last observed sample.
Trait Implementations§
Source§impl Clone for CheckpointStats
impl Clone for CheckpointStats
Source§fn clone(&self) -> CheckpointStats
fn clone(&self) -> CheckpointStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more