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: usizeCount 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: usizeNumber 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: usizeNumber 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: usizeThe byte cap in effect when a truncation occurred, for the diagnostic.
Implementations§
Source§impl ProcessingStats
impl ProcessingStats
pub fn new() -> Self
Sourcepub fn format_stats(&self, _multiline_enabled: bool) -> String
pub fn format_stats(&self, _multiline_enabled: bool) -> String
Format stats according to the specification
Sourcepub fn format_stats_json(&self) -> String
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.
Sourcepub fn format_stats_for_signal(
&self,
_multiline_enabled: bool,
include_line_counts: bool,
) -> String
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.
Sourcepub fn format_ragged_rows_summary(&self) -> Option<String>
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.
Sourcepub fn has_errors(&self) -> bool
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.
Sourcepub fn has_fatal_errors(&self, strict: bool) -> bool
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
--assertviolation 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.
Sourcepub fn format_decode_warning(&self) -> Option<String>
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).
Sourcepub fn format_line_truncation_warning(&self) -> Option<String>
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.
Sourcepub fn format_error_summary(&self) -> String
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
impl Clone for ProcessingStats
Source§fn clone(&self) -> ProcessingStats
fn clone(&self) -> ProcessingStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Variant trait object to &mut dyn Any.Source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Variant trait object to Box<dyn Any>.