Skip to main content

MetricsSnapshot

Struct MetricsSnapshot 

Source
pub struct MetricsSnapshot {
Show 15 fields pub classified: u64, pub rejected: u64, pub unauthenticated: u64, pub throttled: u64, pub cache_hits: u64, pub cache_misses: u64, pub billed: u64, pub billed_units: u64, pub free: u64, pub free_by_reason: [u64; 11], pub duplicates: u64, pub record_failures: u64, pub deferred: u64, pub unrecognized_responses: u64, pub unrecognized_by_reason: [u64; 4],
}
Expand description

Point-in-time metric values.

Fields§

§classified: u64

Successfully classified requests.

§rejected: u64

Requests rejected for malformed or ambiguous MCP headers.

§unauthenticated: u64

Requests refused for a missing, malformed, or unknown API key. Tracked apart from rejected so credential stuffing is distinguishable from clients that simply send bad protocol headers.

§throttled: u64

Requests refused because the authentication-failure budget was spent.

§cache_hits: u64

Responses served from cache.

§cache_misses: u64

Cacheable requests not served from cache.

§billed: u64

Delivered calls accepted by the recorder.

§billed_units: u64

Sum of delivered units accepted by the recorder.

§free: u64

Exchanges classified as free.

§free_by_reason: [u64; 11]

Free exchanges split by reason, indexed by FreeReason::index.

The single free total cannot answer the question the enum exists for: a spike in missing_task_attribution means durable-task charges are being lost, and collapsed into one counter it is indistinguishable from ordinary discovery traffic.

§duplicates: u64

Repeated once-only charges suppressed by the recorder.

§record_failures: u64

Local recorder failures.

§deferred: u64

Terminal accounting parked because it could not finish without awaiting. Only a durable task store produces these.

§unrecognized_responses: u64

Bodies that ended without a parseable terminal response.

§unrecognized_by_reason: [u64; 4]

Unaccounted responses split by cause, indexed by UnaccountedReason::index.

Implementations§

Source§

impl MetricsSnapshot

Source

pub fn render_prometheus(self) -> String

Render this snapshot in the Prometheus text exposition format.

Trait Implementations§

Source§

impl Clone for MetricsSnapshot

Source§

fn clone(&self) -> MetricsSnapshot

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 MetricsSnapshot

Source§

impl Debug for MetricsSnapshot

Source§

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

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

impl Default for MetricsSnapshot

Source§

fn default() -> MetricsSnapshot

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

impl Eq for MetricsSnapshot

Source§

impl PartialEq for MetricsSnapshot

Source§

fn eq(&self, other: &MetricsSnapshot) -> 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 MetricsSnapshot

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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 = !

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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