pub struct MetricsCollector { /* private fields */ }Expand description
Subscribes to the domain-event stream and maintains a running snapshot.
Implementations§
Source§impl MetricsCollector
impl MetricsCollector
pub fn new() -> Self
pub fn snapshot(&self) -> TelemetrySnapshot
Sourcepub fn observe(&mut self, env: &EventEnvelope)
pub fn observe(&mut self, env: &EventEnvelope)
Fold one event into the snapshot. Reads only numeric/enum fields.
Trait Implementations§
Source§impl Debug for MetricsCollector
impl Debug for MetricsCollector
Source§impl Default for MetricsCollector
impl Default for MetricsCollector
Source§fn default() -> MetricsCollector
fn default() -> MetricsCollector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MetricsCollector
impl RefUnwindSafe for MetricsCollector
impl Send for MetricsCollector
impl Sync for MetricsCollector
impl Unpin for MetricsCollector
impl UnsafeUnpin for MetricsCollector
impl UnwindSafe for MetricsCollector
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