Trait Counted

Source
pub trait Counted<T>
where T: ToCounterValue,
{ // Required method fn count_with_tags<'a>( &'a self, key: &'a str, count: T, ) -> MetricBuilder<'_, '_, Counter>; // Provided method fn count(&self, key: &str, count: T) -> MetricResult<Counter> { ... } }
Expand description

Trait for incrementing and decrementing counters.

Counters are simple values incremented or decremented by a client. The rates at which these events occur or average values will be determined by the server receiving them. Examples of counter uses include number of logins to a system or requests received.

The following types are valid for counters:

  • i64

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§

Source

fn count_with_tags<'a>( &'a self, key: &'a str, count: T, ) -> MetricBuilder<'_, '_, Counter>

Increment or decrement the counter by the given amount and return a MetricBuilder that can be used to add tags to the metric.

Provided Methods§

Source

fn count(&self, key: &str, count: T) -> MetricResult<Counter>

Increment or decrement the counter by the given amount

Implementors§