Struct dipstick::AppMetrics
[−]
[src]
pub struct AppMetrics<M> { /* fields omitted */ }
Variations of this should also provide control of the metric recording scope.
Methods
impl<M> AppMetrics<M> where
M: Clone + Send + Sync + 'static,
[src]
M: Clone + Send + Sync + 'static,
pub fn marker<AS: AsRef<str>>(&self, name: AS) -> AppMarker<M>
[src]
Get an event counter of the provided name.
pub fn counter<AS: AsRef<str>>(&self, name: AS) -> AppCounter<M>
[src]
Get a counter of the provided name.
pub fn timer<AS: AsRef<str>>(&self, name: AS) -> AppTimer<M>
[src]
Get a timer of the provided name.
pub fn gauge<AS: AsRef<str>>(&self, name: AS) -> AppGauge<M>
[src]
Get a gauge of the provided name.
pub fn flush(&self)
[src]
Forcefully flush the backing metrics scope. This is usually not required since static metrics use auto flushing scopes. The effect, if any, of this method depends on the selected metrics backend.
pub fn flush_every(&self, period: Duration) -> CancelHandle
[src]
Schedule for the metrics aggregated of buffered by downstream metrics sinks to be sent out at regular intervals.
Trait Implementations
impl<M> From<Chain<M>> for AppMetrics<M>
[src]
fn from(chain: Chain<M>) -> AppMetrics<M>
[src]
Performs the conversion.
impl<M> Debug for AppMetrics<M> where
M: Debug,
[src]
M: Debug,
fn fmt(&self, __f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<M: Clone> Clone for AppMetrics<M>
[src]
fn clone(&self) -> AppMetrics<M>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<M: Send + Sync + Clone + 'static> WithNamespace for AppMetrics<M>
[src]
fn with_name<IN: Into<Namespace>>(&self, names: IN) -> Self
[src]
Join namespace and prepend in newly defined metrics.
fn with_prefix<AS: AsRef<str>>(&self, prefix: AS) -> Self
[src]
Insert prefix in newly defined metrics.
fn with_namespace(&self, names: &[&str]) -> Self
[src]
Join namespace and prepend in newly defined metrics.
impl<M: Send + Sync + Clone + 'static> WithCache for AppMetrics<M>
[src]
fn with_cache(&self, cache_size: usize) -> Self
[src]
Cache metrics to prevent them from being re-defined on every use.
impl<M: Send + Sync + Clone + 'static> WithSamplingRate for AppMetrics<M>
[src]
fn with_sampling_rate(&self, sampling_rate: Rate) -> Self
[src]
Perform random sampling of values according to the specified rate.
impl<M: Send + Sync + Clone + 'static> WithAsyncQueue for AppMetrics<M>
[src]
fn with_async_queue(&self, queue_size: usize) -> Self
[src]
Enqueue collected metrics for dispatch on background thread.