Skip to main content

Classes

Struct Classes 

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

How many decisions were made on what.

The class histogram of spec/stats/09-measurement.md section 9.5. For a whole suite, the fraction of the planner’s decisions that were exact, certified, estimated or unknown, which is the direct measurement of whether the statistics layer is doing its job. It is more diagnostic than q-error for the first several milestones, because early on the estimates are bad for the boring reason that there are none.

Implementations§

Source§

impl Classes

Source

pub const fn new() -> Self

An empty histogram.

Source

pub fn record<T>(&mut self, stat: &Stat<T>)

Counts one decision.

Source

pub fn record_class(&mut self, class: Option<Class>)

Counts one decision whose class is already in hand.

Source

pub const fn exact(self) -> u64

Decisions made on an exact number.

Source

pub const fn certified(self) -> u64

Decisions made on a bounded number.

Source

pub const fn estimated(self) -> u64

Decisions made on a guess.

Source

pub const fn unknown(self) -> u64

Decisions made with no number at all.

Source

pub const fn total(self) -> u64

Every decision counted.

Source

pub fn known_share(self) -> f64

The fraction of decisions that had a number of any kind behind them, zero for an empty histogram.

Source

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

Adds another histogram into this one, for a report that covers a suite rather than a query.

Trait Implementations§

Source§

impl Clone for Classes

Source§

fn clone(&self) -> Classes

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 Classes

Source§

impl Debug for Classes

Source§

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

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

impl Default for Classes

Source§

fn default() -> Classes

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

impl Display for Classes

Source§

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

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

impl Eq for Classes

Source§

impl PartialEq for Classes

Source§

fn eq(&self, other: &Classes) -> 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 Classes

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.