pub struct ColumnSketches { /* private fields */ }Expand description
All per-column accumulators bundled behind one seeded, mergeable, bounded
facade. Feed values with observe; combine partitions with
merge; finalize to ColumnEvidence with
finish.
Implementations§
Source§impl ColumnSketches
impl ColumnSketches
Sourcepub fn new(budget: &ProfileBudget, seed: u64) -> Self
pub fn new(budget: &ProfileBudget, seed: u64) -> Self
Build a fresh set of accumulators sized to budget and seeded by
seed (only the reservoir is randomized; the seed makes its sample
reproducible).
Sourcepub fn observe(&mut self, value: ProfileValue<'_>)
pub fn observe(&mut self, value: ProfileValue<'_>)
Fold one column value into every relevant accumulator.
Sourcepub fn merge(&mut self, other: ColumnSketches) -> Result<(), ProfileError>
pub fn merge(&mut self, other: ColumnSketches) -> Result<(), ProfileError>
Merge another partition’s sketches into this one. Fails only if the two were built with incompatible budgets.
Sourcepub fn distinct_estimate(&self) -> f64
pub fn distinct_estimate(&self) -> f64
HyperLogLog estimate of distinct non-null values.
Sourcepub fn retained_items(&self) -> usize
pub fn retained_items(&self) -> usize
Count of variably-retained items (reservoir + top-k + histogram bins). Fixed-size structures (HLL registers) are excluded — they are memory, not budget-scaled “items”.
Sourcepub fn retained_bytes(&self) -> usize
pub fn retained_bytes(&self) -> usize
Honest count of bytes retained across every accumulator.
Sourcepub fn finish(self) -> ColumnEvidence
pub fn finish(self) -> ColumnEvidence
Consume the sketches into neutral, bounded ColumnEvidence.
Auto Trait Implementations§
impl Freeze for ColumnSketches
impl RefUnwindSafe for ColumnSketches
impl Send for ColumnSketches
impl Sync for ColumnSketches
impl Unpin for ColumnSketches
impl UnsafeUnpin for ColumnSketches
impl UnwindSafe for ColumnSketches
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more