Skip to main content

KeyStats

Struct KeyStats 

Source
pub struct KeyStats {
    pub provenance: Provenance,
    pub count: u64,
    pub declined: u64,
    pub distinct: u64,
    pub min: Option<Value>,
    pub max: Option<Value>,
    pub numeric_count: u64,
    pub int_sum: i128,
    pub float_sum: f64,
    pub heavy: Vec<HeavyValue>,
}
Expand description

The statistics of one (label, property), over the values the collector’s type gate admitted.

Fields§

§provenance: Provenance

How the figures were produced.

§count: u64

Admitted values read.

§declined: u64

Values of this key the type gate declined (long text, lists).

§distinct: u64

Estimated distinct admitted values, never above count.

§min: Option<Value>

Smallest value, for a key whose values share one orderable family.

§max: Option<Value>

Largest value, under the same condition as min.

§numeric_count: u64

Values that are numbers: the denominator of KeyStats::mean.

§int_sum: i128

Sum of the integer values (saturating).

§float_sum: f64

Sum of the float values.

§heavy: Vec<HeavyValue>

The most frequent values, most frequent first.

Implementations§

Source§

impl KeyStats

Source

pub fn mean(&self) -> Option<f64>

The mean of the numeric values, None when there are none or the sum is not finite (a key holding an infinity, or +inf with -inf, has no meaningful mean).

Source

pub fn equality_rows(&self, heavy_count: Option<u64>, label_rows: u64) -> u64

The row estimate of an equality on this key, for a label of label_rows nodes: the value’s own count when the caller found it among the heavy values (by the store’s equality identity, which a plain Value comparison does not share: an integer and an equal float are one value there), otherwise the admitted values spread over the distinct count. Never zero for a label that has rows (a value the sketch did not see may still exist) and never above the label’s rows.

Trait Implementations§

Source§

impl Clone for KeyStats

Source§

fn clone(&self) -> Self

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 KeyStats

Source§

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

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

impl PartialEq for KeyStats

Source§

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

Auto Trait Implementations§

§

impl Forget for KeyStats

§

impl Freeze for KeyStats
where *const ArcInner<str> is !null: Freeze, PhantomData<ArcInner<str>>: Freeze, *const ArcInner<Vec<Value>> is !null: Freeze, PhantomData<ArcInner<Vec<Value>>>: Freeze, *const ArcInner<BTreeMap<String, Value>> is !null: Freeze, PhantomData<ArcInner<BTreeMap<String, Value>>>: Freeze, *const ArcInner<Node> is !null: Freeze, PhantomData<ArcInner<Node>>: Freeze, *const ArcInner<Relationship> is !null: Freeze, PhantomData<ArcInner<Relationship>>: Freeze, *const ArcInner<Path> is !null: Freeze, PhantomData<ArcInner<Path>>: Freeze, NonZero<i32>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *const CivilZonedFields is !null: Freeze, PhantomData<CivilZonedFields>: Freeze, *const ArcInner<[f32]> is !null: Freeze, PhantomData<ArcInner<[f32]>>: Freeze, *const ArcInner<[f64]> is !null: Freeze, PhantomData<ArcInner<[f64]>>: Freeze, *const ArcInner<[i64]> is !null: Freeze, PhantomData<ArcInner<[i64]>>: Freeze, *const ArcInner<[u8]> is !null: Freeze, PhantomData<ArcInner<[u8]>>: Freeze, PhantomData<HeavyValue>: Freeze,

§

impl Move for KeyStats

§

impl RefUnwindSafe for KeyStats

§

impl Send for KeyStats

§

impl Sync for KeyStats

§

impl Unpin for KeyStats

§

impl UnsafeUnpin for KeyStats
where *const ArcInner<str> is !null: UnsafeUnpin, PhantomData<ArcInner<str>>: UnsafeUnpin, *const ArcInner<Vec<Value>> is !null: UnsafeUnpin, PhantomData<ArcInner<Vec<Value>>>: UnsafeUnpin, *const ArcInner<BTreeMap<String, Value>> is !null: UnsafeUnpin, PhantomData<ArcInner<BTreeMap<String, Value>>>: UnsafeUnpin, *const ArcInner<Node> is !null: UnsafeUnpin, PhantomData<ArcInner<Node>>: UnsafeUnpin, *const ArcInner<Relationship> is !null: UnsafeUnpin, PhantomData<ArcInner<Relationship>>: UnsafeUnpin, *const ArcInner<Path> is !null: UnsafeUnpin, PhantomData<ArcInner<Path>>: UnsafeUnpin, NonZeroI32Inner: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const CivilZonedFields is !null: UnsafeUnpin, PhantomData<CivilZonedFields>: UnsafeUnpin, *const ArcInner<[f32]> is !null: UnsafeUnpin, PhantomData<ArcInner<[f32]>>: UnsafeUnpin, *const ArcInner<[f64]> is !null: UnsafeUnpin, PhantomData<ArcInner<[f64]>>: UnsafeUnpin, *const ArcInner<[i64]> is !null: UnsafeUnpin, PhantomData<ArcInner<[i64]>>: UnsafeUnpin, *const ArcInner<[u8]> is !null: UnsafeUnpin, PhantomData<ArcInner<[u8]>>: UnsafeUnpin, PhantomData<HeavyValue>: UnsafeUnpin,

§

impl UnwindSafe for KeyStats

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.