Trait cadence::MetricSink
[−]
[src]
pub trait MetricSink { fn emit(&self, metric: &str) -> Result<usize>; }
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|c
Timer
some.timer:456|ms
Gauge
some.gauge:5|g
Meter
some.meter:8|m
Histogram
some.histogram:4|h
See the Statsd spec for more information.
Required Methods
fn emit(&self, metric: &str) -> Result<usize>
Send the Statsd metric using this sink and return the number of bytes written or an I/O error.
Implementors
impl MetricSink for QueuingMetricSink
impl<T: 'static + MetricSink + Send + Sync> MetricSink for AsyncMetricSink<T>
impl MetricSink for UdpMetricSink
impl MetricSink for BufferedUdpMetricSink
impl MetricSink for NopMetricSink