Enum relay_metrics::MetricType
source · pub enum MetricType {
Counter,
Distribution,
Set,
Gauge,
}
Expand description
The type of a MetricResourceIdentifier
, determining its aggregation and evaluation.
Variants§
Counter
Counts instances of an event.
Counters can be incremented and decremented. The default operation is to increment a counter
by 1
, although increments by larger values are equally possible.
Counters are declared as "c"
. Alternatively, "m"
is allowed.
Distribution
Builds a statistical distribution over values reported.
Based on individual reported values, distributions allow to query the maximum, minimum, or average of the reported values, as well as statistical quantiles. With an increasing number of values in the distribution, its accuracy becomes approximate.
Distributions are declared as "d"
. Alternatively, "d"
and "ms"
are allowed.
Set
Counts the number of unique reported values.
Sets allow sending arbitrary discrete values, including strings, and store the deduplicated count. With an increasing number of unique values in the set, its accuracy becomes approximate. It is not possible to query individual values from a set.
Sets are declared as "s"
.
Gauge
Stores absolute snapshots of values.
In addition to plain counters, gauges store a snapshot of the maximum, minimum and sum of all values, as well as the last reported value.
Gauges are declared as "g"
.
Implementations§
Trait Implementations§
source§impl Clone for MetricType
impl Clone for MetricType
source§fn clone(&self) -> MetricType
fn clone(&self) -> MetricType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MetricType
impl Debug for MetricType
source§impl<'de> Deserialize<'de> for MetricType
impl<'de> Deserialize<'de> for MetricType
source§fn deserialize<D>(
deserializer: D,
) -> Result<MetricType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<MetricType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
source§impl Display for MetricType
impl Display for MetricType
source§impl FromStr for MetricType
impl FromStr for MetricType
source§type Err = ParseMetricError
type Err = ParseMetricError
source§fn from_str(s: &str) -> Result<MetricType, <MetricType as FromStr>::Err>
fn from_str(s: &str) -> Result<MetricType, <MetricType as FromStr>::Err>
s
to return a value of this type. Read moresource§impl Hash for MetricType
impl Hash for MetricType
source§impl Ord for MetricType
impl Ord for MetricType
source§fn cmp(&self, other: &MetricType) -> Ordering
fn cmp(&self, other: &MetricType) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for MetricType
impl PartialEq for MetricType
source§impl PartialOrd for MetricType
impl PartialOrd for MetricType
source§impl Serialize for MetricType
impl Serialize for MetricType
source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl Copy for MetricType
impl Eq for MetricType
impl StructuralPartialEq for MetricType
Auto Trait Implementations§
impl Freeze for MetricType
impl RefUnwindSafe for MetricType
impl Send for MetricType
impl Sync for MetricType
impl Unpin for MetricType
impl UnwindSafe for MetricType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.