Skip to main content

MethodMetrics

Struct MethodMetrics 

Source
pub struct MethodMetrics {
    pub requests: u64,
    pub errors: BTreeMap<String, u64>,
    pub latency_buckets: [u64; 11],
    pub total_micros: u64,
    pub max_micros: u64,
    pub per_minute: Vec<(u64, u64)>,
}
Expand description

What the counters hold for one method.

Fields§

§requests: u64

Requests that reached the handler.

§errors: BTreeMap<String, u64>

Requests that returned an error, by error code.

§latency_buckets: [u64; 11]

Requests per latency bucket: index i counts latencies up to LATENCY_BOUNDS_MS[i], the last index everything slower.

§total_micros: u64

Sum of the latencies, microseconds.

§max_micros: u64

The slowest request, microseconds.

§per_minute: Vec<(u64, u64)>

(minute since the epoch, requests in it), oldest first, at most the last hour.

Implementations§

Source§

impl MethodMetrics

Source

pub fn error_count(&self) -> u64

Requests that returned an error, in all.

Source

pub fn requests_in_minute_of(&self, now: SystemTime) -> u64

Requests in the minute that contains now (wall clock), for a rate reading.

Trait Implementations§

Source§

impl Clone for MethodMetrics

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 MethodMetrics

Source§

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

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

impl Default for MethodMetrics

Source§

fn default() -> Self

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

impl Eq for MethodMetrics

Source§

impl PartialEq for MethodMetrics

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 MethodMetrics

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.