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(&mut self, state: &PipelineState)
pub fn maybe_record(&mut self, state: &PipelineState)
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(
&mut self,
state: &PipelineState,
backend: &mut dyn TelemetryBackend,
)
pub fn record_and_emit( &mut self, state: &PipelineState, backend: &mut dyn TelemetryBackend, )
Record a snapshot and send to telemetry backend.
Trait Implementations§
Auto 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> 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