3 unstable releases

0.2.2 Jun 11, 2019
0.2.0 May 1, 2019
0.1.0 Apr 24, 2019

#342 in Value formatting

Download history 26/week @ 2023-10-29 27/week @ 2023-11-05 29/week @ 2023-11-12 26/week @ 2023-11-19 33/week @ 2023-11-26 27/week @ 2023-12-03 21/week @ 2023-12-10 25/week @ 2023-12-17 32/week @ 2023-12-24 24/week @ 2023-12-31 26/week @ 2024-01-07 22/week @ 2024-01-14 27/week @ 2024-01-21 29/week @ 2024-01-28 25/week @ 2024-02-04 39/week @ 2024-02-11

123 downloads per month

MIT license

11KB
175 lines

metrics-recorder-text

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

metrics-recorder-text is a metric recorder that outputs a hierarchical, text-based format.

code of conduct

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


lib.rs:

Records metrics in a hierarchical, text-based format.

Metric scopes are used to provide the hierarchy and indentation of metrics. As an example, for a snapshot with two metrics — server.msgs_received and server.msgs_sent — we would expect to see this output:

root:
  server:
    msgs_received: 42
    msgs_sent: 13

If we added another metric — configuration_reloads — we would expect to see:

root:
  configuration_reloads: 2
  server:
    msgs_received: 42
    msgs_sent: 13

Metrics are sorted alphabetically.

Histograms

Histograms are rendered with a configurable set of quantiles that are provided when creating an instance of TextRecorder. They are formatted using human-readable labels when displayed to the user. For example, 0.0 is rendered as "min", 1.0 as "max", and anything in between using the common "pXXX" format i.e. a quantile of 0.5 or percentile of 50 would be p50, a quantile of 0.999 or percentile of 99.9 would be p999, and so on.

All histograms have the sample count of the histogram provided in the output.

root:
  connect_time count: 15
  connect_time min: 1334
  connect_time p50: 1934
  connect_time p99: 5330
  connect_time max: 139389

Dependencies

~1.5MB
~20K SLoC