Skip to main content

Spent

Struct Spent 

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

How long each stage took and how many bytes went through it.

The bytes are here rather than worked out later because a rate is the number that says whether a stage is slow. Two hundred milliseconds of decompression is a fact about a query and two hundred megabytes a second is a fact about the decompressor, and only the second one can be compared against anything.

Implementations§

Source§

impl Spent

Source

pub const fn none() -> Self

Nothing measured, which is what every operator that is not a scan reports.

Source

pub const fn nanos(&self, stage: Stage) -> u64

How long this stage took.

Source

pub const fn bytes(&self, stage: Stage) -> u64

How many bytes went through it.

Source

pub fn total(&self) -> u64

Every stage, added up.

Source

pub fn is_empty(&self) -> bool

Whether no stage recorded anything.

Source

pub fn taken(&self) -> impl Iterator<Item = (Stage, u64, u64)> + '_

Every stage that did something, in the order Stage::ALL lists them.

The order is the order the bytes go through the stages rather than largest first, because this is what the document is written from and a document whose keys move with its numbers is one nobody can diff. Whoever wants the largest asks Self::worst.

Source

pub fn worst(&self) -> Option<(Stage, u64)>

The stage holding the most time, or none if nothing was measured.

Source

pub fn since(&self, before: Self) -> Self

What happened between before and this reading.

Saturating, so a reader that takes the two the wrong way round reports nothing rather than most of a century.

Source

pub fn add(&mut self, other: Self)

Adds another reading into this one.

Source

pub fn of(stage: Stage, nanos: u64, bytes: u64) -> Self

One stage’s worth, for a caller that has a number rather than a running total.

Trait Implementations§

Source§

impl Clone for Spent

Source§

fn clone(&self) -> Spent

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 Copy for Spent

Source§

impl Debug for Spent

Source§

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

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

impl Default for Spent

Source§

fn default() -> Spent

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

impl Eq for Spent

Source§

impl PartialEq for Spent

Source§

fn eq(&self, other: &Spent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Spent

Auto Trait Implementations§

§

impl Freeze for Spent

§

impl RefUnwindSafe for Spent

§

impl Send for Spent

§

impl Sync for Spent

§

impl Unpin for Spent

§

impl UnsafeUnpin for Spent

§

impl UnwindSafe for Spent

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

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.