pub struct Telemetry { /* private fields */ }Expand description
Main telemetry collector.
Implementations§
Source§impl Telemetry
impl Telemetry
Sourcepub fn new(config: TelemetryConfig) -> Self
pub fn new(config: TelemetryConfig) -> Self
Create new telemetry collector.
Sourcepub fn default_config() -> Self
pub fn default_config() -> Self
Create with default configuration.
Sourcepub fn record_operation(&mut self, name: &str, duration_us: u64)
pub fn record_operation(&mut self, name: &str, duration_us: u64)
Record operation timing (microseconds).
Sourcepub fn increment_counter(&mut self, name: &str)
pub fn increment_counter(&mut self, name: &str)
Increment a counter.
Sourcepub fn add_to_counter(&mut self, name: &str, value: u64)
pub fn add_to_counter(&mut self, name: &str, value: u64)
Add to a counter.
Sourcepub fn snapshot(&self) -> TelemetrySnapshot
pub fn snapshot(&self) -> TelemetrySnapshot
Get current snapshot.
Sourcepub fn uptime_secs(&self) -> u64
pub fn uptime_secs(&self) -> u64
Get uptime in seconds.
Auto Trait Implementations§
impl Freeze for Telemetry
impl RefUnwindSafe for Telemetry
impl Send for Telemetry
impl Sync for Telemetry
impl Unpin for Telemetry
impl UnwindSafe for Telemetry
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