pub struct SpyMetricSink { /* private fields */ }
Expand description

MetricSink implementation that writes all metrics to the Sender half of a channel while callers are given ownership of the Receiver half.

This is not a general purpose sink, rather it’s a sink meant for verifying metrics written during the course of integration tests. By default, the channel used is unbounded. The channel size can be limited using the with_capacity method.

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

Implementations

Trait Implementations

Formats the value using the given formatter. Read more

Send the Statsd metric using this sink and return the number of bytes written or an I/O error. Read more

Flush any currently buffered metrics to the underlying backend, returning an I/O error if they could not be written for some reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.