Skip to main content

CheckpointStats

Struct CheckpointStats 

Source
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: u64

Process-lifetime count of successful checkpoints. Failed (poisoned, IO error) checkpoints do NOT advance this.

§last_write_us: u64

Snapshot serialize + tmp+rename duration (µs).

§last_sync_us: u64

WAL flush_now + chunk rotation duration (µs).

§last_total_us: u64

End-to-end checkpoint duration (µs) = write + manifest + sync + rotate.

§last_wal_bytes: u64

Bytes of WAL that fell behind the marker (= WAL written during this checkpoint, roughly).

§last_snapshot_bytes: u64

Snapshot bytes written to disk.

§last_files_synced: u32

Files 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

Source

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

Source§

fn clone(&self) -> CheckpointStats

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CheckpointStats

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CheckpointStats

Source§

fn default() -> CheckpointStats

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.