Skip to main content

Crate iroh_metrics

Crate iroh_metrics 

Source
Expand description

Metrics library for iroh

Modules§

encoding
Functions to encode metrics into the OpenMetrics text format.
iterable
Traits for iterating over the fields of structs.
service
Background services that expose or forward metrics from this crate.
static_core
Metrics collection in a static, process-level global metrics collector.

Macros§

dec
Decrements the given metric by 1.
dec_by
Decrements the given metric by n.
inc
Increments the given metric by 1.
inc_by
Increments the given metric by n.
set
Sets the given metric to n.

Structs§

Counter
OpenMetrics Counter to measure discrete events.
Family
A family of metrics indexed by labels.
FamilyItem
A family metric item for iteration.
Gauge
OpenMetrics Gauge.
Histogram
OpenMetrics Histogram to track distributions of values.
MetricItem
A metric item with its current value.
NoLabels
Empty label set for metrics that don’t need labels.
Registry
A registry for MetricsGroup.

Enums§

Error
Potential errors from this library.
LabelValue
A label value that can be encoded as a string for OpenMetrics output.
MetricType
The types of metrics supported by this crate.
MetricValue
The value of an individual metric item.

Traits§

EncodeLabelSet
Trait for types that can be encoded as a set of labels.
EncodeLabelValue
Encodes a single field as a LabelValue.
FamilyEncoder
Type-erased encoding interface for a Family.
Metric
Trait for metric items.
MetricsGroup
Trait for structs containing metric items.
MetricsGroupSet
Trait for a set of structs implementing MetricsGroup.
MetricsSource
Helper trait to abstract over different ways to access metrics.

Functions§

parse_prometheus_metrics
Parses Prometheus metrics from a string.

Type Aliases§

LabelPair
A key-value label pair.
RwLockRegistry
A cloneable Registry in a read-write lock.

Derive Macros§

EncodeLabelSet
Derives EncodeLabelSet for a struct.
EncodeLabelValue
Derives EncodeLabelValue for an enum with only unit variants.
MetricsGroup
Derives MetricsGroup and Iterable.
MetricsGroupSet
Derives MetricsGroupSet for a struct.