Skip to main content

Counters

Struct Counters 

Source
pub struct Counters {
Show 13 fields pub repository_scans: AtomicU64, pub index_builds: AtomicU64, pub registry_builds: AtomicU64, pub schema_generations: AtomicU64, pub mcp_projection_builds: AtomicU64, pub openapi_builds: AtomicU64, pub http_projection_builds: AtomicU64, pub graph_builds: AtomicU64, pub executions: AtomicU64, pub handler_invocations: AtomicU64, pub cache_hits: AtomicU64, pub cache_misses: AtomicU64, pub cache_evictions: AtomicU64, /* private fields */
}
Expand description

One counter per unit of work. Each is incremented at exactly one place in the code, named in its doc comment.

Fields§

§repository_scans: AtomicU64

discovery::discover: one enumeration of the repository’s declared sources.

§index_builds: AtomicU64

Index::build.

§registry_builds: AtomicU64

CapabilityRegistry::builder().build().

§schema_generations: AtomicU64

CanonicalSchema::of: one JSON Schema derived from a Rust type.

§mcp_projection_builds: AtomicU64

Surface’s tool and resource listings computed (once per shared listing).

§openapi_builds: AtomicU64

openapi::document.

§http_projection_builds: AtomicU64

Router::new.

§graph_builds: AtomicU64

graph::derive: one graph derived from the registry and the index.

§executions: AtomicU64

CapabilityExecutor::execute: every call through every transport.

§handler_invocations: AtomicU64

Handlers actually run (an execution the cache did not answer), at every depth: a handler that composes another capability through the executor counts both, which is how composition is seen to use the one execution path rather than reach into another module behind it. So handler_invocations equals executions minus cache_hits, and an execution that ran a handler twice is exactly what breaks it.

§cache_hits: AtomicU64

Executions answered from the cache.

§cache_misses: AtomicU64

Executions of a cached capability that ran the handler.

§cache_evictions: AtomicU64

Entries dropped to keep a capability under its max_entries, or past their TTL.

Implementations§

Source§

impl Counters

Source

pub fn bump(counter: &AtomicU64)

Add one to a counter.

Source

pub fn snapshot(&self) -> CounterSnapshot

The counters and phases as they stand.

Trait Implementations§

Source§

impl Debug for Counters

Source§

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

Formats the value using the given formatter. 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
§

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

§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

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, 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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more