pub struct ServerMetrics { /* private fields */ }Expand description
Collected metrics for the AstraeaDB server.
Implementations§
Source§impl ServerMetrics
impl ServerMetrics
Sourcepub fn record_request(&self, request_type: &str)
pub fn record_request(&self, request_type: &str)
Record a request of the given type.
Sourcepub fn record_error(&self, request_type: &str)
pub fn record_error(&self, request_type: &str)
Record a request error.
Sourcepub fn record_duration(&self, request_type: &str, duration: Duration)
pub fn record_duration(&self, request_type: &str, duration: Duration)
Record the duration of a request in microseconds.
Sourcepub fn connection_opened(&self)
pub fn connection_opened(&self)
Increment active connection count.
Sourcepub fn connection_closed(&self)
pub fn connection_closed(&self)
Decrement active connection count.
Sourcepub fn active_connections(&self) -> u64
pub fn active_connections(&self) -> u64
Get current active connection count.
Sourcepub fn total_connections(&self) -> u64
pub fn total_connections(&self) -> u64
Get total connections since startup.
Sourcepub fn to_prometheus(&self) -> String
pub fn to_prometheus(&self) -> String
Export metrics in Prometheus text exposition format.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ServerMetrics
impl RefUnwindSafe for ServerMetrics
impl Send for ServerMetrics
impl Sync for ServerMetrics
impl Unpin for ServerMetrics
impl UnsafeUnpin for ServerMetrics
impl UnwindSafe for ServerMetrics
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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