Skip to main content

QueryCounters

Struct QueryCounters 

Source
pub struct QueryCounters {
    pub nodes_visited: u64,
    pub approx_distances: u64,
    pub exact_distances: u64,
    pub seeks: u64,
    pub bytes_read: u64,
    pub sequential_runs: u64,
}
Expand description

Physical counters accumulated by a single query as it executes.

These are the quantities the engine actually measures and the quantities the storage-aware claims are stated in terms of. A hops-only view records only nodes_visited; the storage-access terms (seeks, bytes_read, sequential_runs) are exactly what that view omits.

Fields§

§nodes_visited: u64

Nodes popped from the candidate queue (graph hops). Drives traversal cost.

§approx_distances: u64

Approximate (PQ/ADC) distances computed.

§exact_distances: u64

Exact (full SIMD) distances computed on fetched vectors.

§seeks: u64

Physical positioning operations (seeks) issued to storage.

§bytes_read: u64

Total bytes read from storage.

§sequential_runs: u64

Number of coalesced sequential runs the reads collapsed into.

With perfect demand paging this equals seeks; with elevator scheduling and graph-aware layout it can be far smaller, which is the effect the scheduler is meant to produce.

Implementations§

Source§

impl QueryCounters

Source

pub const fn new() -> Self

A zeroed counter set.

Source

pub fn visit_node(&mut self)

Record a node pop (one graph hop).

Source

pub fn add_approx(&mut self, n: u64)

Record n approximate distance computations.

Source

pub fn add_exact(&mut self, n: u64)

Record n exact distance computations.

Source

pub fn add_read(&mut self, bytes: u64, seeks: u64, runs: u64)

Record a physical read of bytes that required seeks positioning operations and collapsed into runs sequential runs.

Source

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

Merge another counter set into this one (e.g. across parallel workers).

Trait Implementations§

Source§

impl Clone for QueryCounters

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 Copy for QueryCounters

Source§

impl Debug for QueryCounters

Source§

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

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

impl Default for QueryCounters

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for QueryCounters

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for QueryCounters

Source§

impl PartialEq for QueryCounters

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 Serialize for QueryCounters

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for QueryCounters

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.