1 stable release
1.0.0 | Jun 2, 2021 |
---|
Used in metriki-core
6KB
83 lines
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
Dependencies
~1.5MB
~37K SLoC