pub struct InterceptorMetrics { /* private fields */ }Expand description
Metrics collected by the logging interceptor.
Implementations§
Source§impl InterceptorMetrics
impl InterceptorMetrics
Sourcepub fn record_success(&self)
pub fn record_success(&self)
Record a successful request.
Sourcepub fn record_failure(&self)
pub fn record_failure(&self)
Record a failed request.
Sourcepub fn total_requests(&self) -> u64
pub fn total_requests(&self) -> u64
Get the total number of requests.
Sourcepub fn successful_requests(&self) -> u64
pub fn successful_requests(&self) -> u64
Get the number of successful requests.
Sourcepub fn failed_requests(&self) -> u64
pub fn failed_requests(&self) -> u64
Get the number of failed requests.
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Get the success rate (0.0 to 1.0).
Trait Implementations§
Source§impl Debug for InterceptorMetrics
impl Debug for InterceptorMetrics
Source§impl Default for InterceptorMetrics
impl Default for InterceptorMetrics
Source§fn default() -> InterceptorMetrics
fn default() -> InterceptorMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for InterceptorMetrics
impl RefUnwindSafe for InterceptorMetrics
impl Send for InterceptorMetrics
impl Sync for InterceptorMetrics
impl Unpin for InterceptorMetrics
impl UnwindSafe for InterceptorMetrics
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request