[][src]Struct hotmic::Sink

pub struct Sink<T: Clone + Eq + Hash + Display> { /* fields omitted */ }

Handle for sending metric samples into the receiver.

Sink is cloneable, and can not only send metric samples but can register and deregister metric facets at any time.

Methods

impl<T: Clone + Eq + Hash + Display> Sink<T>[src]

pub fn scoped<'a, S: AsScoped<'a> + ?Sized>(&self, scope: &'a S) -> Sink<T>[src]

Creates a scoped clone of this Sink.

Scoping controls the resulting metric name for any metrics sent by this Sink. For example, you might have a metric called messages_sent.

With scoping, you could have independent versions of the same metric. This is useful for having the same "base" metric name but with broken down values.

Going further with the above example, if you had a server, and listened on multiple addresses, maybe you would have a scoped Sink per listener, and could end up with metrics that look like this:

  • listener.a.messages_sent
  • listener.b.messages_sent
  • listener.c.messages_sent
  • etc

Scopes are also inherited. If you create a scoped Sink from another Sink which is already scoped, the scopes will be merged together using a . as the string separator. This makes it easy to nest scopes. Cloning a scoped Sink, though, will inherit the same scope as the original.

pub fn clock(&self) -> &Clock[src]

Reference to the internal high-speed clock interface.

pub fn update_count(&self, key: T, delta: i64)[src]

Updates the count for a given metric.

pub fn update_gauge(&self, key: T, value: u64)[src]

Updates the value for a given metric.

This can be used either for setting a gauge or updating a value histogram.

pub fn update_timing(&self, key: T, start: u64, end: u64)[src]

Updates the timing histogram for a given metric.

pub fn update_timing_with_count(&self, key: T, start: u64, end: u64, count: u64)[src]

Updates the timing histogram for a given metric, with a count.

pub fn update_value(&self, key: T, value: u64)[src]

Updates the value histogram for a given metric.

pub fn increment(&self, key: T)[src]

Increments the given metric by one.

pub fn decrement(&self, key: T)[src]

Decrements the given metric by one.

Trait Implementations

impl<T: Clone + Eq + Hash + Display> Clone for Sink<T>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<T> Send for Sink<T> where
    T: Send

impl<T> Sync for Sink<T> where
    T: Send

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Erased for T