pub struct ConsolidationStats {
pub processed: usize,
pub archived: usize,
pub merged: usize,
pub contradictions: usize,
pub summaries_created: usize,
}Expand description
Statistics from a consolidation operation.
Tracks the outcome of consolidation operations including memory processing, archival, merging, summary creation, and contradiction detection.
§Examples
use subcog::services::ConsolidationStats;
let stats = ConsolidationStats {
processed: 10,
archived: 2,
merged: 1,
contradictions: 0,
summaries_created: 3,
};
println!("{}", stats.summary());
assert!(!stats.is_empty());Fields§
§processed: usizeNumber of memories processed.
archived: usizeNumber of memories archived.
merged: usizeNumber of memories merged.
contradictions: usizeNumber of contradictions detected.
summaries_created: usizeNumber of summary nodes created.
Implementations§
Source§impl ConsolidationStats
impl ConsolidationStats
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Returns true if no consolidation work was performed.
A stats instance is considered empty if all counters are zero.
§Examples
use subcog::services::ConsolidationStats;
let empty_stats = ConsolidationStats::default();
assert!(empty_stats.is_empty());
let stats = ConsolidationStats {
processed: 5,
..Default::default()
};
assert!(!stats.is_empty());Sourcepub fn summary(&self) -> String
pub fn summary(&self) -> String
Returns a human-readable summary of the consolidation operation.
Provides a formatted string with all statistics for display purposes.
§Examples
use subcog::services::ConsolidationStats;
let stats = ConsolidationStats {
processed: 10,
archived: 2,
merged: 1,
contradictions: 1,
summaries_created: 3,
};
let summary = stats.summary();
assert!(summary.contains("Processed: 10"));
assert!(summary.contains("Summaries: 3"));
// Empty stats show special message
let empty = ConsolidationStats::default();
assert_eq!(empty.summary(), "No memories to consolidate");Trait Implementations§
Source§impl Clone for ConsolidationStats
impl Clone for ConsolidationStats
Source§fn clone(&self) -> ConsolidationStats
fn clone(&self) -> ConsolidationStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConsolidationStats
impl Debug for ConsolidationStats
Source§impl Default for ConsolidationStats
impl Default for ConsolidationStats
Source§fn default() -> ConsolidationStats
fn default() -> ConsolidationStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConsolidationStats
impl RefUnwindSafe for ConsolidationStats
impl Send for ConsolidationStats
impl Sync for ConsolidationStats
impl Unpin for ConsolidationStats
impl UnwindSafe for ConsolidationStats
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].