[−][src]Trait cadence::prelude::Timed
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.
Note that tags are a Datadog extension to Statsd and may not be supported by your server.
Required methods
fn time_with_tags<'a>(
&'a self,
key: &'a str,
time: u64
) -> MetricBuilder<'_, '_, Timer>
&'a self,
key: &'a str,
time: u64
) -> MetricBuilder<'_, '_, Timer>
Record a timing in milliseconds with the given key and return a
MetricBuilder
that can be used to add tags to the metric.
fn time_duration_with_tags<'a>(
&'a self,
key: &'a str,
duration: Duration
) -> MetricBuilder<'_, '_, Timer>
&'a self,
key: &'a str,
duration: Duration
) -> MetricBuilder<'_, '_, Timer>
Record a timing in milliseconds with the given key and return a
MetricBuilder
that can be used to add tags to the metric.
The duration will be truncated to millisecond precision. If the
duration cannot be represented as a u64
an error will be deferred
and returned when MetricBuilder::try_send()
is called.
Provided 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 milliseconds 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
[src]
fn time_with_tags<'a>(
&'a self,
key: &'a str,
time: u64
) -> MetricBuilder<'_, '_, Timer>
[src]
&'a self,
key: &'a str,
time: u64
) -> MetricBuilder<'_, '_, Timer>
fn time_duration_with_tags<'a>(
&'a self,
key: &'a str,
duration: Duration
) -> MetricBuilder<'_, '_, Timer>
[src]
&'a self,
key: &'a str,
duration: Duration
) -> MetricBuilder<'_, '_, Timer>