pub struct MigrationOpTracker { /* private fields */ }
Expand description
A MigrationOpTracker is responsible for managing the collection of measurements that a user might wish to record throughout a migration-assisted operation.
Example measurements include latency, errors, and consistency.
Implementations§
Source§impl MigrationOpTracker
impl MigrationOpTracker
Sourcepub fn operation(&mut self, operation: Operation)
pub fn operation(&mut self, operation: Operation)
Sets the migration related operation associated with these tracking measurements.
Sourcepub fn invoked(&mut self, origin: Origin)
pub fn invoked(&mut self, origin: Origin)
Allows recording which origins were called during a migration.
Sourcepub fn consistent(&mut self, is_consistent: impl Fn() -> bool)
pub fn consistent(&mut self, is_consistent: impl Fn() -> bool)
This method accepts a callable which should take no parameters and return a single boolean to represent the consistency check results for a read operation.
A callable is provided in case sampling rules do not require consistency checking to run. In this case, we can avoid the overhead of a function by not using the callable.
Sourcepub fn error(&mut self, origin: Origin)
pub fn error(&mut self, origin: Origin)
Allows recording which origins were called during a migration.
Sourcepub fn latency(&mut self, origin: Origin, latency: Duration)
pub fn latency(&mut self, origin: Origin, latency: Duration)
Allows tracking the recorded latency for an individual operation.
Sourcepub fn build(&self) -> Result<MigrationOpEvent, String>
pub fn build(&self) -> Result<MigrationOpEvent, String>
Creates an instance of crate::MigrationOpEvent. This event data can be provided to the crate::Client::track_migration_op method to rely this metric information upstream to LaunchDarkly services.
Auto Trait Implementations§
impl Freeze for MigrationOpTracker
impl RefUnwindSafe for MigrationOpTracker
impl Send for MigrationOpTracker
impl Sync for MigrationOpTracker
impl Unpin for MigrationOpTracker
impl UnwindSafe for MigrationOpTracker
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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