metriki-macros

Crates.iometriki-macros
lib.rsmetriki-macros
version1.0.0
sourcesrc
created_at2021-06-02 14:24:10.799644
updated_at2021-06-02 14:24:10.799644
descriptionMacros for metriki
homepagehttps://github.com/sunng87/metriki
repositoryhttps://github.com/sunng87/metriki
max_upload_size
id405314
size6,638
Ning Sun (sunng87)

documentation

https://docs.rs/metriki-macros/

README

Metriki

Metriki is a rust library ported from Dropwizard Metrics.

Like Dropwizard Metrics, Metriki aggregates metrics on client-side and outputs limited amount data.

#[timed]
fn your_function() {
  // a function metered by a timer for its rate and latency
}

use metriki_core::global::global_registry;

Components

Concepts

Metrics

  • Counter: a value that can be increased and decreased.
  • Meter: measures rate of an event.
  • Histogram: records distribution of data over time.
  • Timer: a combination of meter and histogram.
  • Gauge: a function that provides value when queried.

MetricsRegistry

An entrypoint and holder of all metrics.

MetricsSet

A trait to be implemented so that dynamic metrics can be added into registry. Metrics from the set are pulled into registry everytime when reporters and exporters pulling values from the registry.

Reporter

A component to report metric data periodically. Typically used for data sinks which has a push-model.

Exporter

A component to expose metric data to external queriers. Typically for pull based data sinks.

License

MIT/Apache-2.0

Commit count: 360

cargo fmt