Skip to main content

ScanStats

Struct ScanStats 

Source
pub struct ScanStats {
    pub lines: u64,
    pub bytes: u64,
    pub lines_skipped: u64,
    pub finder_lines_skipped: u64,
    pub positions: u64,
    pub coarse_positions: u64,
    pub candidate_positions: u64,
    pub run_gated: u64,
    pub coarse_rejected: Vec<u64>,
    pub matches: u64,
    pub sorts: u64,
    pub finders: Vec<FinderStats>,
}
Expand description

Operation counters collected by Scanner::scan_line_stats.

The counters describe how much work the scanner and its finders did, so that performance can be reasoned about independently of wall-clock time: a finder invocation is the unit of work the scanner dispatches, and the ratio of invocations to hits shows how well candidate filtering works.

Fields§

§lines: u64

Lines scanned (including empty lines).

§bytes: u64

Bytes scanned.

§lines_skipped: u64

Lines on which the prescan disabled every finder.

§finder_lines_skipped: u64

Finder×line pairs disabled by the prescan.

§positions: u64

Positions visited by the dispatch and trigger loops (one per byte and per loop that ran).

§coarse_positions: u64

Positions the vector stage passed on to the exact gates (Strategy::Vector only).

§candidate_positions: u64

Positions where at least one candidate finder was invoked.

§run_gated: u64

Finder invocations avoided by run rules.

§coarse_rejected: Vec<u64>

Coarse positions the exact gates rejected, by the byte at the position (diagnostics for the vector stage’s precision).

§matches: u64

Matches returned to the caller.

§sorts: u64

Lines whose matches had to be sorted.

§finders: Vec<FinderStats>

One entry per finder, in scanner order.

Implementations§

Source§

impl ScanStats

Source

pub fn for_scanner(scanner: &Scanner) -> Self

Creates counters sized for scanner.

Source

pub fn merge(&mut self, other: &ScanStats)

Adds other into self; both must come from scanners with the same finder list.

Source

pub fn calls(&self) -> u64

Total finder invocations of any mode.

Source

pub fn hits(&self) -> u64

Total finder invocations that returned Some.

Trait Implementations§

Source§

impl Clone for ScanStats

Source§

fn clone(&self) -> Self

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 ScanStats

Source§

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

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

impl Default for ScanStats

Source§

fn default() -> Self

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

impl Eq for ScanStats

Source§

impl PartialEq for ScanStats

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ScanStats

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.