pub struct StatsAggregator { /* private fields */ }
Expand description
Statistics aggregator for processing and summarizing collected data
Implementations§
Source§impl StatsAggregator
impl StatsAggregator
Sourcepub fn add_record(&mut self, record: StatsRecord)
pub fn add_record(&mut self, record: StatsRecord)
Add a statistics record to the aggregator
Sourcepub fn add_records(&mut self, records: Vec<StatsRecord>)
pub fn add_records(&mut self, records: Vec<StatsRecord>)
Add multiple statistics records to the aggregator
Sourcepub fn record_count(&self) -> usize
pub fn record_count(&self) -> usize
Get the number of records in the aggregator
Sourcepub fn summarize(&self) -> Result<StatsSummary>
pub fn summarize(&self) -> Result<StatsSummary>
Generate a summary of all records
Sourcepub fn summarize_time_range(
&self,
start: DateTime<Utc>,
end: DateTime<Utc>,
) -> Result<StatsSummary>
pub fn summarize_time_range( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> Result<StatsSummary>
Summarize records within a specific time range
Sourcepub fn summarize_by_source(&self) -> Result<HashMap<String, StatsSummary>>
pub fn summarize_by_source(&self) -> Result<HashMap<String, StatsSummary>>
Summarize records by source
Sourcepub fn filter_by_source(&self, source: &str) -> Vec<&StatsRecord>
pub fn filter_by_source(&self, source: &str) -> Vec<&StatsRecord>
Get records filtered by source
Sourcepub fn filter_by_time_range(
&self,
start: DateTime<Utc>,
end: DateTime<Utc>,
) -> Vec<&StatsRecord>
pub fn filter_by_time_range( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> Vec<&StatsRecord>
Get records filtered by time range
Trait Implementations§
Source§impl Clone for StatsAggregator
impl Clone for StatsAggregator
Source§fn clone(&self) -> StatsAggregator
fn clone(&self) -> StatsAggregator
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 StatsAggregator
impl Debug for StatsAggregator
Auto Trait Implementations§
impl Freeze for StatsAggregator
impl RefUnwindSafe for StatsAggregator
impl Send for StatsAggregator
impl Sync for StatsAggregator
impl Unpin for StatsAggregator
impl UnwindSafe for StatsAggregator
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