pub struct TelemetrySender<T: Telemetry> { /* private fields */ }Expand description
Sender-side handle that implements Telemetry and forwards all calls
to the core via a multi-producer, single-consumer channel.
Implementations§
Source§impl<T: Telemetry> TelemetrySender<T>
impl<T: Telemetry> TelemetrySender<T>
Sourcepub fn send_shutdown(&self)
pub fn send_shutdown(&self)
Send an explicit shutdown message to the telemetry core.
After this call, the core will exit its run loop once it processes the message and perform a final flush.
Trait Implementations§
Source§impl<T: Telemetry> Clone for TelemetrySender<T>
impl<T: Telemetry> Clone for TelemetrySender<T>
Source§impl<T: Telemetry> Telemetry for TelemetrySender<T>
impl<T: Telemetry> Telemetry for TelemetrySender<T>
Source§const METRICS_ENABLED: bool = T::METRICS_ENABLED
const METRICS_ENABLED: bool = T::METRICS_ENABLED
Compile-time flag indicating whether this telemetry implementation
wants metrics (counters, gauges, latencies) at all. Read more
Source§const EVENTS_STATICALLY_ENABLED: bool = T::EVENTS_STATICALLY_ENABLED
const EVENTS_STATICALLY_ENABLED: bool = T::EVENTS_STATICALLY_ENABLED
Compile-time flag indicating whether this telemetry implementation
ever produces structured events. Read more
Source§fn incr_counter(&mut self, key: TelemetryKey, delta: u64)
fn incr_counter(&mut self, key: TelemetryKey, delta: u64)
Increment a counter metric identified by the given key. Read more
Source§fn set_gauge(&mut self, key: TelemetryKey, value: u64)
fn set_gauge(&mut self, key: TelemetryKey, value: u64)
Set a gauge metric identified by the given key. Read more
Source§fn record_latency_ns(&mut self, key: TelemetryKey, value_ns: u64)
fn record_latency_ns(&mut self, key: TelemetryKey, value_ns: u64)
Record a latency sample in nanoseconds for the given key. Read more
Source§fn push_metrics(&mut self)
fn push_metrics(&mut self)
Optional: push a snapshot of aggregated metrics to the sink. Read more
Source§fn events_enabled(&self) -> bool
fn events_enabled(&self) -> bool
Return true if this telemetry collector wants structured events. Read more
Source§fn push_event(&mut self, event: TelemetryEvent)
fn push_event(&mut self, event: TelemetryEvent)
Emit a structured telemetry event. Read more
Auto Trait Implementations§
impl<T> Freeze for TelemetrySender<T>
impl<T> RefUnwindSafe for TelemetrySender<T>where
T: RefUnwindSafe,
impl<T> Send for TelemetrySender<T>where
T: Send,
impl<T> Sync for TelemetrySender<T>where
T: Sync,
impl<T> Unpin for TelemetrySender<T>where
T: Unpin,
impl<T> UnsafeUnpin for TelemetrySender<T>
impl<T> UnwindSafe for TelemetrySender<T>where
T: UnwindSafe,
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