Enum hotmic::Sample[][src]

pub enum Sample<T> {
    Timing(T, InstantInstantu64),
    Count(T, i64),
    Value(T, u64),
}

A measurement.

Samples are the decoupled way of submitting data into the sink. Likewise with facets, metric types/measurements are slightly decoupled, into facets and samples, so that we can allow slightly more complicated and unique combinations of facets.

If you wanted to track, all time, the count of a given metric, but also the distribution of the metric, you would need both a counter and histogram, as histograms are windowed. Instead of creating two metric names, and having two separate calls, you can simply register both the count and timing percentile facets, and make one call, and both things are tracked for you.

There are multiple sample types to support the different types of measurements, which each have their own specific data they must carry.

Variants

A timed sample.

Includes the start and end times, as well as a count field.

The count field can represent amounts integral to the event, such as the number of bytes processed in the given time delta.

A counter delta.

The value is added directly to the existing counter, and so negative deltas will decrease the counter, and positive deltas will increase the counter.

A single value, also known as a gauge.

Values operate in last-write-wins mode.

Values themselves cannot be incremented or decremented, so you must hold them externally before sending them.

Trait Implementations

impl<T: Debug> Debug for Sample<T>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

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

impl<T> Sync for Sample<T> where
    T: Sync