pub struct TelemetryCollector { /* private fields */ }Expand description
Accumulates LaunchTelemetry entries and produces summaries.
The collector can be enabled/disabled at runtime and caps the number
of stored entries to max_entries to bound memory usage.
Implementations§
Source§impl TelemetryCollector
impl TelemetryCollector
Sourcepub fn new(max_entries: usize) -> Self
pub fn new(max_entries: usize) -> Self
Creates a new collector that stores up to max_entries telemetry records.
Sourcepub fn record(&mut self, telemetry: LaunchTelemetry)
pub fn record(&mut self, telemetry: LaunchTelemetry)
Records a telemetry entry.
If the collector is disabled or the entry count has reached
max_entries, the entry is silently dropped.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns whether the collector is currently enabled.
Sourcepub fn entries(&self) -> &[LaunchTelemetry]
pub fn entries(&self) -> &[LaunchTelemetry]
Returns a reference to all recorded entries.
Sourcepub fn summary(&self) -> TelemetrySummary
pub fn summary(&self) -> TelemetrySummary
Computes a summary of all recorded telemetry.
If no entries have been recorded, returns a zeroed summary.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TelemetryCollector
impl RefUnwindSafe for TelemetryCollector
impl Send for TelemetryCollector
impl Sync for TelemetryCollector
impl Unpin for TelemetryCollector
impl UnsafeUnpin for TelemetryCollector
impl UnwindSafe for TelemetryCollector
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