pub struct SegmentStats {
pub n_vectors: usize,
pub n_deleted: usize,
pub size_bytes: u64,
pub created_at: SystemTime,
pub last_accessed: SystemTime,
pub access_count: u64,
pub quantizer_meta: QuantizerMeta,
pub error_samples: Vec<f32>,
}Expand description
Segment statistics for compaction decisions
Fields§
§n_vectors: usizeTotal vectors in segment
n_deleted: usizeDeleted vectors (tombstones)
size_bytes: u64Segment size in bytes
created_at: SystemTimeCreated timestamp
last_accessed: SystemTimeLast access timestamp
access_count: u64Number of accesses
quantizer_meta: QuantizerMetaQuantizer metadata
error_samples: Vec<f32>Quantization error samples (for drift detection)
Implementations§
Source§impl SegmentStats
impl SegmentStats
Sourcepub fn deletion_ratio(&self) -> f32
pub fn deletion_ratio(&self) -> f32
Get deletion ratio
Sourcepub fn live_vectors(&self) -> usize
pub fn live_vectors(&self) -> usize
Get live vector count
Sourcepub fn record_error(&mut self, error: f32)
pub fn record_error(&mut self, error: f32)
Record quantizer error sample
Sourcepub fn estimated_error(&self) -> f32
pub fn estimated_error(&self) -> f32
Get current estimated quantizer error
Sourcepub fn needs_retraining(&self, threshold: f32) -> bool
pub fn needs_retraining(&self, threshold: f32) -> bool
Check if quantizer needs retraining
Trait Implementations§
Source§impl Clone for SegmentStats
impl Clone for SegmentStats
Source§fn clone(&self) -> SegmentStats
fn clone(&self) -> SegmentStats
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SegmentStats
impl RefUnwindSafe for SegmentStats
impl Send for SegmentStats
impl Sync for SegmentStats
impl Unpin for SegmentStats
impl UnsafeUnpin for SegmentStats
impl UnwindSafe for SegmentStats
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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