[−][src]Struct hotmic::Sink
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
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.