pub struct MetricsCollector { /* private fields */ }Expand description
Metrics collector that receives and aggregates metrics from agents.
Implementations§
Source§impl MetricsCollector
impl MetricsCollector
Sourcepub fn with_config(config: MetricsCollectorConfig) -> Self
pub fn with_config(config: MetricsCollectorConfig) -> Self
Create a new metrics collector with custom configuration.
Sourcepub fn record(&self, report: &MetricsReport)
pub fn record(&self, report: &MetricsReport)
Record a metrics report from an agent.
Sourcepub fn expire_old_metrics(&self)
pub fn expire_old_metrics(&self)
Remove expired metrics.
Sourcepub fn series_count(&self) -> usize
pub fn series_count(&self) -> usize
Get the number of active metric series.
Sourcepub fn active_agents(&self) -> Vec<String>
pub fn active_agents(&self) -> Vec<String>
Get active agent IDs.
Sourcepub fn export_prometheus(&self) -> String
pub fn export_prometheus(&self) -> String
Export metrics in Prometheus text format.
Sourcepub fn snapshot(&self) -> MetricsSnapshot
pub fn snapshot(&self) -> MetricsSnapshot
Get a snapshot of all metrics.
Trait Implementations§
Source§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 UnsafeUnpin 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> 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