pub struct MemoryMetricsCollector { /* private fields */ }Expand description
Memory metrics collector for pipeline execution.
Implementations§
Source§impl MemoryMetricsCollector
impl MemoryMetricsCollector
Sourcepub const fn new(snapshot_interval: u32) -> Self
pub const fn new(snapshot_interval: u32) -> Self
Create a new metrics collector.
§Arguments
snapshot_interval- Take snapshot every N iterations (0 = disabled)
Sourcepub fn maybe_record(&self, state: &PipelineState) -> Self
pub fn maybe_record(&self, state: &PipelineState) -> Self
Record a snapshot if at snapshot interval.
Sourcepub fn snapshots(&self) -> &[MemorySnapshot]
pub fn snapshots(&self) -> &[MemorySnapshot]
Get all recorded snapshots.
Sourcepub fn export_json(&self) -> Result<String>
pub fn export_json(&self) -> Result<String>
Sourcepub fn record_and_emit(
&self,
state: &PipelineState,
backend: &dyn TelemetryBackend,
) -> Self
pub fn record_and_emit( &self, state: &PipelineState, backend: &dyn TelemetryBackend, ) -> Self
Record a snapshot and send to telemetry backend.
Trait Implementations§
Source§impl Clone for MemoryMetricsCollector
impl Clone for MemoryMetricsCollector
Source§fn clone(&self) -> MemoryMetricsCollector
fn clone(&self) -> MemoryMetricsCollector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MemoryMetricsCollector
impl RefUnwindSafe for MemoryMetricsCollector
impl Send for MemoryMetricsCollector
impl Sync for MemoryMetricsCollector
impl Unpin for MemoryMetricsCollector
impl UnsafeUnpin for MemoryMetricsCollector
impl UnwindSafe for MemoryMetricsCollector
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more