[][src]Struct cadence::SpyMetricSink

pub struct SpyMetricSink { /* fields omitted */ }

MetricSink implementation that writes all metrics to a shared Write instance that callers retain a reference to.

This is not a general purpose sink, rather it's a sink meant for verifying metrics written during the course of integration tests. Due to the requirement that callers retain a shared reference to the underlying Write implementation, this sink uses more locking (mutexes) than other sinks in Cadence. Thus, it should not be used in production, only testing.

Each metric is sent to the underlying writer when the .emit() method is called, in the thread of the caller.

Implementations

impl SpyMetricSink[src]

pub fn from(
    writer: Arc<Mutex<dyn Write + Send + RefUnwindSafe + 'static>>
) -> Self
[src]

Trait Implementations

impl Debug for SpyMetricSink[src]

impl MetricSink for SpyMetricSink[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.