pub struct MetricCollector { /* private fields */ }Expand description
A metric collector that uses lock-free ring buffers
Implementations§
Source§impl MetricCollector
impl MetricCollector
Sourcepub fn new(name: String, config: MonitoringConfig) -> Self
pub fn new(name: String, config: MonitoringConfig) -> Self
Create a new metric collector
Sourcepub fn with_channel(
name: String,
config: MonitoringConfig,
sender: Sender<Vec<Metric>>,
) -> Self
pub fn with_channel( name: String, config: MonitoringConfig, sender: Sender<Vec<Metric>>, ) -> Self
Create a collector connected to a processing channel
Sourcepub fn start_flusher(&self) -> Result<JoinHandle<()>>
pub fn start_flusher(&self) -> Result<JoinHandle<()>>
Start the background flushing thread
Sourcepub fn stats(&self) -> CollectorStats
pub fn stats(&self) -> CollectorStats
Get collector statistics
Sourcepub fn buffer_size(&self) -> usize
pub fn buffer_size(&self) -> usize
Get the current buffer size
Auto Trait Implementations§
impl Freeze for MetricCollector
impl !RefUnwindSafe for MetricCollector
impl Send for MetricCollector
impl Sync for MetricCollector
impl Unpin for MetricCollector
impl !UnwindSafe for MetricCollector
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