Skip to main content

IndexProgress

Struct IndexProgress 

Source
pub struct IndexProgress { /* private fields */ }
Expand description

The counter. Every field is an atomic so the hot path pays one relaxed add.

Implementations§

Source§

impl IndexProgress

Source

pub fn new(root: &str) -> Arc<Self> ⓘ

A counter for the store rooted at root, registered process-wide.

Source

pub fn detached() -> Arc<Self> ⓘ

A counter nobody reads, for a caller with no store behind it.

Source

pub fn root(&self) -> &str

Source

pub fn begin(&self, pack_id: u64, bytes_total: u64, resumed: bool)

A pack begins. resumed = the journal queued it, not a push in this process.

Source

pub fn set_total(&self, objects: u64)

The walk is done and the object count is known.

Source

pub fn set_phase(&self, phase: Phase)

Source

pub fn object_done(&self, bytes: u64)

The hot-path call: one object resolved, covering bytes of the pack.

Source

pub fn add_reinflations(&self, n: u64)

Source

pub fn add_pause(&self)

Source

pub fn sample_memory(&self)

Read /proc once and publish it on the counter.

Two file reads, so it is a tick’s work and never the hot path’s: the ticker calls it every TICK, add_pause calls it when a pause opens, and the absorber calls it when a pack ends. Everything else reads the published value out of a Snapshot.

Source

pub fn rate(&self) -> u64

Objects per second since begin, or 0 before the clock has moved.

Source

pub fn finish(&self)

The pack is absorbed (or abandoned): the row goes idle.

Source

pub fn snapshot(&self) -> Snapshot

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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: 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 = !

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

fn try_from(value: U) -> Result<T, !>

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<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