Struct dipstick::InputMetric
source · pub struct InputMetric { /* private fields */ }
Expand description
A metric is actually a function that knows to write a metric value to a metric output.
Implementations§
source§impl InputMetric
impl InputMetric
sourcepub fn new<F: Fn(MetricValue, Labels) + Send + Sync + 'static>(
identifier: MetricId,
metric: F
) -> InputMetric
pub fn new<F: Fn(MetricValue, Labels) + Send + Sync + 'static>(
identifier: MetricId,
metric: F
) -> InputMetric
Utility constructor
sourcepub fn write(&self, value: MetricValue, labels: Labels)
pub fn write(&self, value: MetricValue, labels: Labels)
Collect a new value for this metric.
Trait Implementations§
source§impl Clone for InputMetric
impl Clone for InputMetric
source§fn clone(&self) -> InputMetric
fn clone(&self) -> InputMetric
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for InputMetric
impl Debug for InputMetric
source§impl From<InputMetric> for Counter
impl From<InputMetric> for Counter
source§fn from(metric: InputMetric) -> Counter
fn from(metric: InputMetric) -> Counter
Converts to this type from the input type.
source§impl From<InputMetric> for Gauge
impl From<InputMetric> for Gauge
source§fn from(metric: InputMetric) -> Gauge
fn from(metric: InputMetric) -> Gauge
Converts to this type from the input type.
source§impl From<InputMetric> for Level
impl From<InputMetric> for Level
source§fn from(metric: InputMetric) -> Level
fn from(metric: InputMetric) -> Level
Converts to this type from the input type.
source§impl From<InputMetric> for Marker
impl From<InputMetric> for Marker
source§fn from(metric: InputMetric) -> Marker
fn from(metric: InputMetric) -> Marker
Converts to this type from the input type.
source§impl From<InputMetric> for Timer
impl From<InputMetric> for Timer
source§fn from(metric: InputMetric) -> Timer
fn from(metric: InputMetric) -> Timer
Converts to this type from the input type.