Trait cadence::MetricSink 
source · [−]pub trait MetricSink {
    fn emit(&self, metric: &str) -> Result<usize>;
    fn flush(&self) -> Result<()> { ... }
}Expand description
Trait for various backends that send Statsd metrics somewhere.
The metric string will be in the canonical format to be sent to a Statsd server. The metric string will not include a trailing newline. Examples of each supported metric type are given below.
Counter
some.counter:123|cTimer
some.timer:456|msGauge
some.gauge:5|gMeter
some.meter:8|mHistogram
some.histogram:4|hSet
some.set:2|sSee the Statsd spec for more information.
Required Methods
Send the Statsd metric using this sink and return the number of bytes written or an I/O error.
Note that implementations may return 0 bytes if the metric is not
immediately written (such as when it is buffered).  Callers should NOT
interpret this as an error.