Skip to main content

ProcessingStats

Struct ProcessingStats 

Source
pub struct ProcessingStats {
Show 47 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 naive_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>, pub csv_rows_extra_columns: usize, pub csv_rows_missing_columns: usize, pub csv_overflow_start_column: Option<usize>, pub first_parse_error_sample: Option<String>, pub decode_warnings: usize, pub first_decode_warning_sample: Option<String>, pub truncated_lines: usize, pub line_byte_cap: 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§naive_timestamps: usize

Count of naive timestamps (no zone offset) resolved using the default timezone. Drives the #287 diagnostic that surfaces the silent UTC assumption; the explicit-vs-default gate is applied at emit time.

§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>§csv_rows_extra_columns: usize§csv_rows_missing_columns: usize§csv_overflow_start_column: Option<usize>§first_parse_error_sample: Option<String>

First raw line that failed to parse, captured for diagnostics. Used to re-detect a likely secondary format when auto-detection locked onto one format but the input turned out to be mixed (see detection.rs).

§decode_warnings: usize

Number of input lines that contained invalid UTF-8 and were decoded losslessly (U+FFFD substitution). Surfaced as a diagnostic so recovery is visible rather than silent; does not count as an error (see #239).

§first_decode_warning_sample: Option<String>

First line where a UTF-8 replacement occurred, captured for diagnostics.

§truncated_lines: usize

Number of input lines that exceeded --max-line-bytes and were truncated to the cap (resilient default). A recovery, not an error: exit code stays 0. See SECURITY.md (“Input-pipeline limits”).

§line_byte_cap: usize

The byte cap in effect when a truncation occurred, for the diagnostic.

Implementations§

Source§

impl ProcessingStats

Source

pub fn new() -> Self

Source

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

Format stats according to the specification

Source

pub fn format_stats_json(&self) -> String

Render the same run statistics as a machine-readable JSON object (--stats=json). The schema mirrors the table view’s logical groups so the two stay in sync; fields that the table omits when empty (ragged rows, output time span, output keys/levels) are likewise only present here when they carry information.

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 format_ragged_rows_summary(&self) -> Option<String>

One-line summary of ragged CSV/TSV rows, or None when none occurred. Factual only — callers that want to suggest –strict append their own advice.

Source

pub fn has_errors(&self) -> bool

Check if any errors occurred during processing.

Used for reporting (whether to print an error summary), not for the exit code — a partial parse failure has errors worth reporting but is recovered. For the exit-code decision use has_fatal_errors.

Source

pub fn has_fatal_errors(&self, strict: bool) -> bool

Stats-side inputs to the exit-code decision (the structural and explicit-gate axes of the v2 error model). The per-record axis (parse / filter / exec “never once succeeded”) lives in the always-on tracker via stage_failed_completely; this covers only what the tracker doesn’t:

  • Structural — a named input file that could not be opened is an invocation/environment error, never data noise, so it fails the run in any mode.
  • Explicit gate — an --assert violation fails the run in any mode.
  • Strict — under --strict, any parse error is fatal (strict also aborts on the first such line before reaching here; this is the belt-and-suspenders end-of-run check). In resilient mode parse errors are recovered unless the parser never once succeeded, which the tracker detects.
Source

pub fn format_decode_warning(&self) -> Option<String>

Format the lossy-UTF-8 decode warning, if any lines were affected. Returned separately from format_error_summary because decode warnings are recoveries, not failures, and must not influence the exit code (#239).

Source

pub fn format_line_truncation_warning(&self) -> Option<String>

Warning for lines clipped by the --max-line-bytes circuit breaker. Returns None when nothing was truncated.

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 (const: unstable) · 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.