pub struct MetricsObserver {
pub resolution_count: AtomicU64,
pub total_resolution_time: AtomicU64,
pub panic_count: AtomicU64,
}Expand description
Performance-focused observer that tracks detailed metrics.
Collects timing data, resolution counts, and failure rates for post-workflow analysis and optimization.
Fields§
§resolution_count: AtomicU64§total_resolution_time: AtomicU64§panic_count: AtomicU64Implementations§
Source§impl MetricsObserver
impl MetricsObserver
Sourcepub fn resolution_count(&self) -> u64
pub fn resolution_count(&self) -> u64
Gets the total number of resolutions observed.
Sourcepub fn average_resolution_time(&self) -> Option<Duration>
pub fn average_resolution_time(&self) -> Option<Duration>
Gets the average resolution time in nanoseconds.
Sourcepub fn total_resolution_time(&self) -> Duration
pub fn total_resolution_time(&self) -> Duration
Gets the total resolution time.
Sourcepub fn panic_count(&self) -> u64
pub fn panic_count(&self) -> u64
Gets the number of panics observed.
Trait Implementations§
Source§impl Default for MetricsObserver
impl Default for MetricsObserver
Source§impl DiObserver for MetricsObserver
impl DiObserver for MetricsObserver
Source§fn resolved(&self, _key: &Key, duration: Duration)
fn resolved(&self, _key: &Key, duration: Duration)
Called when a service is successfully resolved. Read more
Source§fn factory_panic(&self, _key: &Key, _message: &str)
fn factory_panic(&self, _key: &Key, _message: &str)
Called when a factory function panics during resolution. Read more
Source§fn resolved_with_context(
&self,
key: &Key,
duration: Duration,
_context: &ObservationContext,
)
fn resolved_with_context( &self, key: &Key, duration: Duration, _context: &ObservationContext, )
Called when a service is successfully resolved with workflow context. Read more
Source§fn factory_panic_with_context(
&self,
key: &Key,
message: &str,
_context: &ObservationContext,
)
fn factory_panic_with_context( &self, key: &Key, message: &str, _context: &ObservationContext, )
Called when a factory function panics during resolution with workflow context. Read more
Source§fn resolving_with_context(&self, key: &Key, context: &ObservationContext)
fn resolving_with_context(&self, key: &Key, context: &ObservationContext)
Called when starting to resolve a service with workflow context. Read more
Auto Trait Implementations§
impl !Freeze for MetricsObserver
impl RefUnwindSafe for MetricsObserver
impl Send for MetricsObserver
impl Sync for MetricsObserver
impl Unpin for MetricsObserver
impl UnwindSafe for MetricsObserver
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