Skip to main content

ConsolidationMetrics

Struct ConsolidationMetrics 

Source
pub struct ConsolidationMetrics {
Show 40 fields pub groups_flushed: AtomicU64, pub frames_consolidated: AtomicU64, pub transactions_batched: AtomicU64, pub fsyncs_total: AtomicU64, pub flush_duration_us_total: AtomicU64, pub wait_duration_us_total: AtomicU64, pub max_group_size_observed: AtomicU64, pub busy_retries: AtomicU64, pub prepare_us_total: AtomicU64, pub batch_build_us_total: AtomicU64, pub conflict_snapshot_us_total: AtomicU64, pub lane_prepare_us_total: AtomicU64, pub consolidator_lock_wait_us_total: AtomicU64, pub consolidator_flushing_wait_us_total: AtomicU64, pub flusher_arrival_wait_us_total: AtomicU64, pub inner_lock_wait_us_total: AtomicU64, pub exclusive_lock_us_total: AtomicU64, pub wal_append_us_total: AtomicU64, pub flush_frame_prep_us_total: AtomicU64, pub append_conflict_check_us_total: AtomicU64, pub append_frames_us_total: AtomicU64, pub wal_sync_us_total: AtomicU64, pub waiter_epoch_wait_us_total: AtomicU64, pub flusher_commits: AtomicU64, pub waiter_commits: AtomicU64, pub commit_phase_a_us_total: AtomicU64, pub commit_phase_b_us_total: AtomicU64, pub commit_phase_c1_us_total: AtomicU64, pub commit_phase_c2_us_total: AtomicU64, pub commit_phase_count: AtomicU64, pub hist_consolidator_lock_wait: PhaseHistogram, pub hist_arrival_wait: PhaseHistogram, pub hist_wal_backend_lock_wait: PhaseHistogram, pub hist_wal_append: PhaseHistogram, pub hist_exclusive_lock: PhaseHistogram, pub hist_waiter_epoch_wait: PhaseHistogram, pub hist_phase_b: PhaseHistogram, pub hist_wal_sync: PhaseHistogram, pub hist_full_commit: PhaseHistogram, pub wake_reasons: WakeReasonCounters,
}
Expand description

Atomic counters for group commit consolidation observability.

Fields§

§groups_flushed: AtomicU64

Total groups flushed.

§frames_consolidated: AtomicU64

Total frames written via consolidated groups.

§transactions_batched: AtomicU64

Total transactions batched.

§fsyncs_total: AtomicU64

Total fsync operations (one per group).

§flush_duration_us_total: AtomicU64

Total time spent flushing (microseconds).

§wait_duration_us_total: AtomicU64

Total time writers spent waiting for flush (microseconds).

§max_group_size_observed: AtomicU64

Maximum group size observed.

§busy_retries: AtomicU64

Total busy retries during flush (exponential backoff).

§prepare_us_total: AtomicU64

Time building batch before entering consolidator (microseconds).

§batch_build_us_total: AtomicU64

Time cloning staged pages into an owned group-commit batch (microseconds).

§conflict_snapshot_us_total: AtomicU64

Time pinning WAL conflict snapshot and attaching metadata (microseconds).

§lane_prepare_us_total: AtomicU64

Time spent preparing lane-local WAL frame bytes (microseconds).

§consolidator_lock_wait_us_total: AtomicU64

Time waiting to acquire consolidator.lock() (microseconds).

§consolidator_flushing_wait_us_total: AtomicU64

Time waiting while consolidator phase == FLUSHING (microseconds).

§flusher_arrival_wait_us_total: AtomicU64

Time flusher spends waiting for more batches (microseconds).

§inner_lock_wait_us_total: AtomicU64

Time waiting to acquire inner.lock() (microseconds).

§exclusive_lock_us_total: AtomicU64

Time acquiring EXCLUSIVE file lock (microseconds).

§wal_append_us_total: AtomicU64

Time in WAL append_frames (microseconds).

§flush_frame_prep_us_total: AtomicU64

Time preparing flusher frame refs and prepared batches (microseconds).

§append_conflict_check_us_total: AtomicU64

Time checking stale WAL conflicts immediately before append (microseconds).

§append_frames_us_total: AtomicU64

Time spent in the WAL append call itself (microseconds).

§wal_sync_us_total: AtomicU64

Time in WAL sync/fsync (microseconds).

§waiter_epoch_wait_us_total: AtomicU64

Time waiters spend waiting for epoch completion (microseconds).

§flusher_commits: AtomicU64

Count of commits that took flusher role.

§waiter_commits: AtomicU64

Count of commits that took waiter role.

§commit_phase_a_us_total: AtomicU64

Phase A: prepare under inner.lock (microseconds).

§commit_phase_b_us_total: AtomicU64

Phase B: WAL group commit (microseconds).

§commit_phase_c1_us_total: AtomicU64

Phase C1: post-commit metadata under inner.lock (microseconds).

§commit_phase_c2_us_total: AtomicU64

Phase C2: publish to snapshot plane (microseconds).

§commit_phase_count: AtomicU64

Total commits with phase timing recorded.

§hist_consolidator_lock_wait: PhaseHistogram

Distribution: consolidator lock wait.

§hist_arrival_wait: PhaseHistogram

Distribution: arrival wait (flusher only).

§hist_wal_backend_lock_wait: PhaseHistogram

Distribution: WAL backend (inner) lock wait.

§hist_wal_append: PhaseHistogram

Distribution: WAL append_frames.

§hist_exclusive_lock: PhaseHistogram

Distribution: exclusive file lock acquisition.

§hist_waiter_epoch_wait: PhaseHistogram

Distribution: waiter epoch wait.

§hist_phase_b: PhaseHistogram

Distribution: full Phase B (group commit path, flusher + waiter).

§hist_wal_sync: PhaseHistogram

Distribution: WAL sync/fsync.

§hist_full_commit: PhaseHistogram

Distribution: full commit (phase A + B + C).

§wake_reasons: WakeReasonCounters

Why waiters woke up during epoch wait.

Implementations§

Source§

impl ConsolidationMetrics

Source

pub fn new() -> Self

Create zeroed metrics.

Source

pub fn record_flush(&self, frames: u64, transactions: u64, duration_us: u64)

Record a completed group flush.

Source

pub fn record_wait(&self, duration_us: u64)

Record waiter wait time.

Source

pub fn record_busy_retry(&self)

Record a flush retry triggered by a transient busy error.

Source

pub fn record_prepare_breakdown( &self, batch_build_us: u64, conflict_snapshot_us: u64, lane_prepare_us: u64, )

Record pre-queue commit preparation breakdown.

Source

pub fn record_flush_breakdown( &self, flush_frame_prep_us: u64, append_conflict_check_us: u64, append_frames_us: u64, )

Record flusher-side frame preparation and append breakdown.

Source

pub fn record_phase_timing( &self, prepare_us: u64, consolidator_lock_wait_us: u64, consolidator_flushing_wait_us: u64, is_flusher: bool, flusher_arrival_wait_us: u64, inner_lock_wait_us: u64, exclusive_lock_us: u64, wal_append_us: u64, wal_sync_us: u64, waiter_epoch_wait_us: u64, )

Record phase timing for a commit operation.

Source

pub fn record_commit_phases( &self, phase_a_us: u64, phase_b_us: u64, phase_c1_us: u64, phase_c2_us: u64, )

Record full commit path phase timing.

Source

pub fn snapshot(&self) -> ConsolidationMetricsSnapshot

Take a point-in-time snapshot.

Source

pub fn reset(&self)

Reset all counters to zero.

Trait Implementations§

Source§

impl Default for ConsolidationMetrics

Source§

fn default() -> Self

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, _span: NoopSpan) -> Self

Instruments this future with a span (no-op when disabled).
Source§

fn in_current_span(self) -> Self

Instruments this future with the current span (no-op when disabled).
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more