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: ProvenanceHow the figures were produced.
count: u64Admitted values read.
declined: u64Values of this key the type gate declined (long text, lists).
distinct: u64Estimated 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: u64Values that are numbers: the denominator of KeyStats::mean.
int_sum: i128Sum of the integer values (saturating).
float_sum: f64Sum of the float values.
heavy: Vec<HeavyValue>The most frequent values, most frequent first.
Implementations§
Source§impl KeyStats
impl KeyStats
Sourcepub fn mean(&self) -> Option<f64>
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).
Sourcepub fn equality_rows(&self, heavy_count: Option<u64>, label_rows: u64) -> u64
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.