5 unstable releases

0.13.1 Jul 21, 2020
0.13.0 Jan 22, 2020
0.12.1 Dec 17, 2019
0.12.0 Oct 18, 2019
0.1.0 Jul 30, 2019

#10 in #gauge

Download history 733/week @ 2024-07-21 751/week @ 2024-07-28 711/week @ 2024-08-04 499/week @ 2024-08-11 407/week @ 2024-08-18 418/week @ 2024-08-25 707/week @ 2024-09-01 584/week @ 2024-09-08 1167/week @ 2024-09-15 764/week @ 2024-09-22 508/week @ 2024-09-29 577/week @ 2024-10-06 619/week @ 2024-10-13 631/week @ 2024-10-20 581/week @ 2024-10-27 373/week @ 2024-11-03

2,231 downloads per month
Used in 16 crates (8 directly)

MIT license

410KB
6.5K SLoC

metrics

conduct-badge downloads-badge release-badge docs-badge license-badge

metrics is a batteries-included metrics library.

code of conduct

NOTE: All conversations and contributions to this project shall adhere to the Code of Conduct.

what's it all about?

metrics-runtime is the high-quality, batteries-included reference metrics runtime for the Metrics project.

This crate serves to provide support for all of the goals espoused by the project as a whole: a runtime that can be used with metrics, support for interoperating with metrics-core compatible observers and exporters. On top of that, it provides a deliberately designed API meant to help you quickly and easily instrument your application.

As operators of systems at scale, we've attempted to distill this library down to the core features necessary to successfully instrument an application and ensure that you succeed at providing observability into your production systems.

high-level technical features

  • Supports the three most common metric types: counters, gauges, and histograms.
  • Based on metrics-core for composability at the observer/exporter level.
  • Access to ultra-high-speed timing facilities out-of-the-box with quanta.
  • Scoped and labeled metrics for rich dimensionality.
  • Bundled with a number of useful observers/exporters: export your metrics with ease.

performance

Even as a reference runtime, metrics-runtime still has extremely impressive performance. On modern cloud systems, you'll be able to ingest millions of samples per second per core with p99 latencies in the low hundreds of nanoseconds. While metrics-runtime will not be low-enough overhead for every use case, it will meet or exceed the performance of other metrics libraries in Rust and in turn providing you wih fast and predictably low-overhead measurements under production workloads.

There are a few example benchmark programs in the crate that simulate basic workloads. These programs specifically do not attempt to fully simulate a production workload, in terms of number of metrics, frequency of ingestion, or dimensionality. They are brute force benchmarks designed to showcase throughput and latency for varied concurrency profiles under high write contention.

Dependencies

~2.3–4.5MB
~84K SLoC