pub struct MetricsCollector { /* private fields */ }Expand description
MetricsCollector for collecting and exporting Prometheus metrics with thread safety
Implementations§
Source§impl MetricsCollector
impl MetricsCollector
Sourcepub fn ValidateAggregation(&self) -> Result<()>
pub fn ValidateAggregation(&self) -> Result<()>
Validate aggregation window before metric updates
Sourcepub fn RecordRequestSuccess(&self, LatencySeconds: f64)
pub fn RecordRequestSuccess(&self, LatencySeconds: f64)
Record a successful request with thread-safe atomic updates
Sourcepub fn RecordRequestFailure(&self, ErrorType: &str, LatencySeconds: f64)
pub fn RecordRequestFailure(&self, ErrorType: &str, LatencySeconds: f64)
Record a failed request with thread-safe atomic updates
Sourcepub fn UpdateResourceMetrics(
&self,
MemoryBytes: u64,
CPUPercent: f64,
ActiveConns: u64,
ActiveThreads: u64,
)
pub fn UpdateResourceMetrics( &self, MemoryBytes: u64, CPUPercent: f64, ActiveConns: u64, ActiveThreads: u64, )
Update resource usage metrics with thread-safe atomic updates
Sourcepub fn RecordAuthenticationOperation(&self, Success: bool)
pub fn RecordAuthenticationOperation(&self, Success: bool)
Record authentication operation
Sourcepub fn RecordDownload(&self, Success: bool, Bytes: u64)
pub fn RecordDownload(&self, Success: bool, Bytes: u64)
Record download operation
Sourcepub fn RecordIndexingOperation(&self, EntriesIndexed: u64)
pub fn RecordIndexingOperation(&self, EntriesIndexed: u64)
Record indexing operation
Sourcepub fn RecordUpdateCheck(&self, UpdatesAvailable: bool)
pub fn RecordUpdateCheck(&self, UpdatesAvailable: bool)
Record update check
Sourcepub fn ExportMetrics(&self) -> Result<String>
pub fn ExportMetrics(&self) -> Result<String>
Export metrics in Prometheus text format
Sourcepub fn GetMetricsData(&self) -> MetricsData
pub fn GetMetricsData(&self) -> MetricsData
Get metrics as structured data
Trait Implementations§
Source§impl Clone for MetricsCollector
impl Clone for MetricsCollector
Source§fn clone(&self) -> MetricsCollector
fn clone(&self) -> MetricsCollector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetricsCollector
impl Debug for MetricsCollector
Auto Trait Implementations§
impl Freeze for MetricsCollector
impl RefUnwindSafe for MetricsCollector
impl Send for MetricsCollector
impl Sync for MetricsCollector
impl Unpin for MetricsCollector
impl UnwindSafe for MetricsCollector
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].