Expand description
This crate serves to provide metrics bindings to be used throughout the codebase. For binaries that wish to use metrics, the intention is that an independent metrics process will run (main loop in the controller mod), and receive requests via a tube from another process.
At head, metrics requests are ignored. However, a branching codebase can choose to implement their own handler which processes and uploads metrics requests as it sees fit, by setting the appropriate RequestHandler.
Modules§
- Encapsulate the main runtime loop of a metrics process.
- This module contains stats that useful on the system. Local stats may not a be in state to be consumed by metris reporter or it might not be efficient to report metrics in the current state to the backend.
Structs§
- A helper struct to collect metrics for byte transferred and latency.
- A helper struct that makes it easy to get time spent in a scope.
- A histogram that optionally holds details about each added value. These values let us compute standard deviation and median.
- Ensures any cleanup necessary is performed on drop. Can be used to ensure cleanup is done regardless of how the caller exits. Should be idempotent.
- Runs the metrics controller.
- A logging struct meant for use in tracking and periodically logging a single metric. The metric is aggregated over the designated time period. Intended for use with high-frequency metrics.
- Light weight stat struct that helps you get aggregate stats like min, max, average, count and sum. Median and standard deviation are intentionally excluded to keep the structure light weight.
Enums§
Constants§
Traits§
Functions§
- This interface exists to be used and re-implemented by downstream forks. Updates shouldn’t be done without ensuring they won’t cause breakages in dependent codebases.
- Logs a counter with the given descriptor as aux. data. A descriptor is generally an enum value or error code.
- Logs a counter with no aux. data.
- Logs a counter with additional data.
- Logs a high frequency counter with the supplied aux. data and value.
- Logs a histogram metric with the supplied value. Note: step is a value to be added to the distribution.
- Logs a real valued metric (e.g. a data transfer rate, a latency value, etc) with the supplied value.
Type Aliases§
- A helper type alias for Histogram that doesn’t store details. The structure can be used in production without much memory penalty.