pub trait Timed<T> where
T: ToTimerValue, {
fn time_with_tags<'a>(
&'a self,
key: &'a str,
time: T
) -> MetricBuilder<'_, '_, Timer>;
fn time(&self, key: &str, time: T) -> MetricResult<Timer> { ... }
}
Expand description
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. Duration
values are converted to
milliseconds before being recorded.
The following types are valid for timers:
u64
Duration
See the Statsd spec for more information.
Note that tags are a Datadog extension to Statsd and may not be supported by your server.
Required Methods
Record a timing in milliseconds with the given key and return a
MetricBuilder
that can be used to add tags to the metric.
Provided Methods
fn time(&self, key: &str, time: T) -> MetricResult<Timer>
fn time(&self, key: &str, time: T) -> MetricResult<Timer>
Record a timing in milliseconds with the given key