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: u64Requests 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: u64Sum of the latencies, microseconds.
max_micros: u64The 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
impl MethodMetrics
Sourcepub fn error_count(&self) -> u64
pub fn error_count(&self) -> u64
Requests that returned an error, in all.
Sourcepub fn requests_in_minute_of(&self, now: SystemTime) -> u64
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
impl Clone for MethodMetrics
Source§impl Debug for MethodMetrics
impl Debug for MethodMetrics
Source§impl Default for MethodMetrics
impl Default for MethodMetrics
impl Eq for MethodMetrics
Source§impl PartialEq for MethodMetrics
impl PartialEq for MethodMetrics
impl StructuralPartialEq for MethodMetrics
Auto Trait Implementations§
impl Freeze for MethodMetrics
impl RefUnwindSafe for MethodMetrics
impl Send for MethodMetrics
impl Sync for MethodMetrics
impl Unpin for MethodMetrics
impl UnsafeUnpin for MethodMetrics
impl UnwindSafe for MethodMetrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more