Skip to main content

ProcessingStats

Struct ProcessingStats 

Source
pub struct ProcessingStats {
Show 38 fields pub lines_read: usize, pub lines_output: usize, pub lines_filtered: usize, pub lines_errors: usize, pub events_created: usize, pub events_output: usize, pub events_filtered: usize, pub late_events: usize, pub files_processed: usize, pub files_failed_to_open: usize, pub failed_file_samples: Vec<String>, pub recoverable_error_samples: Vec<String>, pub script_executions: usize, pub errors: usize, pub processing_time: Duration, pub start_time: Option<Instant>, pub discovered_levels: BTreeSet<String>, pub discovered_keys: BTreeSet<String>, pub discovered_levels_output: BTreeSet<String>, pub discovered_keys_output: BTreeSet<String>, pub first_timestamp: Option<DateTime<Utc>>, pub last_timestamp: Option<DateTime<Utc>>, pub first_result_timestamp: Option<DateTime<Utc>>, pub last_result_timestamp: Option<DateTime<Utc>>, pub timestamp_detected_events: usize, pub timestamp_parsed_events: usize, pub timestamp_absent_events: usize, pub timestamp_fields: IndexMap<String, TimestampFieldStat>, pub timestamp_override_field: Option<String>, pub timestamp_override_format: Option<String>, pub timestamp_override_failed: bool, pub timestamp_override_warning: Option<String>, pub yearless_timestamps: usize, pub detected_format: Option<String>, pub detected_format_counts: IndexMap<String, usize>, pub cascade_format_counts: IndexMap<String, usize>, pub assertion_failures: usize, pub assertion_failures_by_expr: HashMap<String, usize>,
}
Expand description

Statistics collected during log processing

Fields§

§lines_read: usize§lines_output: usize§lines_filtered: usize§lines_errors: usize§events_created: usize§events_output: usize§events_filtered: usize§late_events: usize§files_processed: usize§files_failed_to_open: usize§failed_file_samples: Vec<String>§recoverable_error_samples: Vec<String>§script_executions: usize§errors: usize§processing_time: Duration§start_time: Option<Instant>§discovered_levels: BTreeSet<String>§discovered_keys: BTreeSet<String>§discovered_levels_output: BTreeSet<String>§discovered_keys_output: BTreeSet<String>§first_timestamp: Option<DateTime<Utc>>§last_timestamp: Option<DateTime<Utc>>§first_result_timestamp: Option<DateTime<Utc>>§last_result_timestamp: Option<DateTime<Utc>>§timestamp_detected_events: usize§timestamp_parsed_events: usize§timestamp_absent_events: usize§timestamp_fields: IndexMap<String, TimestampFieldStat>§timestamp_override_field: Option<String>§timestamp_override_format: Option<String>§timestamp_override_failed: bool§timestamp_override_warning: Option<String>§yearless_timestamps: usize§detected_format: Option<String>§detected_format_counts: IndexMap<String, usize>§cascade_format_counts: IndexMap<String, usize>

Per-format event counts when running in cascade mode. Empty otherwise. Keyed by the short format name used in _format (e.g. “json”, “line”).

§assertion_failures: usize§assertion_failures_by_expr: HashMap<String, usize>

Implementations§

Source§

impl ProcessingStats

Source

pub fn new() -> Self

Source

pub fn extract_discovered_from_tracking( &mut self, tracking_data: &HashMap<String, Dynamic>, )

Extract discovered levels and keys from tracking data (for sequential processing)

Source

pub fn format_stats(&self, _multiline_enabled: bool) -> String

Format stats according to the specification

Source

pub fn format_stats_for_signal( &self, _multiline_enabled: bool, include_line_counts: bool, ) -> String

Format stats for signal handlers

include_line_counts should only be true when we have accurate mid-run counters (e.g., sequential mode). Parallel mode uses partial stats, so keep line counts suppressed there to avoid misleading zeros.

Source

pub fn has_errors(&self) -> bool

Check if any errors occurred during processing

Source

pub fn format_error_summary(&self) -> String

Format a concise error summary for default output (when errors occur)

Trait Implementations§

Source§

impl Clone for ProcessingStats

Source§

fn clone(&self) -> ProcessingStats

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProcessingStats

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProcessingStats

Source§

fn default() -> ProcessingStats

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Variant for T
where T: Any + Clone + SendSync,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert this Variant trait object to &dyn Any.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert this Variant trait object to &mut dyn Any.
Source§

fn as_boxed_any(self: Box<T>) -> Box<dyn Any>

Convert this Variant trait object to Box<dyn Any>.
Source§

fn type_name(&self) -> &'static str

Get the name of this type.
Source§

fn clone_object(&self) -> Box<dyn Variant>

Clone this Variant trait object.