Expand description
§metricus
Contains building blocks.
Structs§
- Counter
- Provides methods to create a new counter, increment it, and increment it by a specified amount. It automatically deletes the counter when it is dropped.
- Histogram
- Facilitates the creation of a new histogram, recording of values, and
generation of spans for timing operations.
The
Histogramdoes not have an inherent notion of measurement units (e.g., milliseconds, bytes) and some convention should be in place. - Metrics
Handle - Metrics backend handle.
- Span
- Used for measuring how long given operation takes. The duration is recorded in nanoseconds.
Enums§
- PreAllocated
Metric - Pre-allocated metric consists of name, id and tags.
Traits§
- Counter
Ops - Defines a series of operations that can be performed on a
Counter. - Histogram
Ops - Defines a series of operations that can be performed on a
Histogram. - Metrics
- Common interface for metrics backend. Each new backend must implement this trait. Implementations must be safe for concurrent use or be used in a strictly single-threaded manner, because the global metrics handle can be shared across threads.
Functions§
- empty_
tags - Returns empty tags.
- get_
metrics_ backend_ name - Get name of the active metrics backend.
- set_
metrics - Set a new metrics backend. This must be called before any counters or histograms are
created (including through macros), because metric objects cache the active handle.
It should also be called before any worker threads start so hot-path loads can use
relaxed ordering. Otherwise, all metrics calls will delegate to the
NoOpMetrics.