pub struct ProcessingStats {
pub articles_processed: u64,
pub bytes_downloaded: u64,
pub bytes_decompressed: u64,
pub errors: u64,
pub duplicates: u64,
pub started_at: Option<DateTime<Utc>>,
pub completed_at: Option<DateTime<Utc>>,
}Expand description
Processing statistics.
Tracks metrics during snapshot/realtime processing including articles processed, bytes transferred, errors, and duplicates.
§Example
use wme_stream::ProcessingStats;
use chrono::Utc;
let mut stats = ProcessingStats::new();
stats.articles_processed = 1000;
stats.bytes_downloaded = 1024 * 1024 * 100; // 100 MB
let rate = stats.rate();
println!("Processing rate: {} articles/sec", rate);Fields§
§articles_processed: u64Total articles processed
bytes_downloaded: u64Total bytes downloaded
bytes_decompressed: u64Total bytes decompressed
errors: u64Errors encountered
duplicates: u64Duplicates removed
started_at: Option<DateTime<Utc>>Start time
completed_at: Option<DateTime<Utc>>End time
Implementations§
Source§impl ProcessingStats
impl ProcessingStats
Sourcepub fn new() -> Self
pub fn new() -> Self
Create new empty stats with current timestamp.
Sets started_at to the current time.
Sourcepub fn merge(&mut self, other: &ProcessingStats)
pub fn merge(&mut self, other: &ProcessingStats)
Merge another stats into this one.
Combines counts from another stats instance. Useful when aggregating stats from multiple chunks or workers.
Trait Implementations§
Source§impl Clone for ProcessingStats
impl Clone for ProcessingStats
Source§fn clone(&self) -> ProcessingStats
fn clone(&self) -> ProcessingStats
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 ProcessingStats
impl Debug for ProcessingStats
Source§impl Default for ProcessingStats
impl Default for ProcessingStats
Source§fn default() -> ProcessingStats
fn default() -> ProcessingStats
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ProcessingStats
impl<'de> Deserialize<'de> for ProcessingStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProcessingStats
impl RefUnwindSafe for ProcessingStats
impl Send for ProcessingStats
impl Sync for ProcessingStats
impl Unpin for ProcessingStats
impl UnsafeUnpin for ProcessingStats
impl UnwindSafe for ProcessingStats
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