Trait cadence::Timed
[−]
[src]
pub trait Timed { fn time(&self, key: &str, time: u64) -> MetricResult<Timer>; fn time_duration(
&self,
key: &str,
duration: Duration
) -> MetricResult<Timer>; }
Trait for recording timings in milliseconds.
Timings are a positive number of milliseconds between a start and end time. Examples include time taken to render a web page or time taken for a database call to return.
See the Statsd spec for more information.
Required Methods
fn time(&self, key: &str, time: u64) -> MetricResult<Timer>
Record a timing in milliseconds with the given key
fn time_duration(&self, key: &str, duration: Duration) -> MetricResult<Timer>
Record a timing in milliseocnds with the given key
The duration will be truncated to millisecond precision. If the
duration cannot be represented as a u64
an error will be returned.
Implementors
impl Timed for StatsdClient