Skip to main content

Measurable

Trait Measurable 

Source
pub trait Measurable: Send + Sync {
    // Required method
    fn measure(&self, config: &MetricConfig, now: i64) -> f64;
}
Expand description

A measurable quantity that can be registered as a metric.

In Java this extends MetricValueProvider<Double> whose value(...) delegates to measure(...); here the crate::common::metrics::MetricValueProvider enum performs that delegation, so a Measurable only needs to provide measure.

Required Methods§

Source

fn measure(&self, config: &MetricConfig, now: i64) -> f64

Measure this quantity and return the result as an f64.

  • config - The configuration for this metric
  • now - The POSIX time in milliseconds the measurement is being taken

Implementors§