metrics/
lib.rs

1// Copyright 2022 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5//! This crate serves to provide metrics bindings to be used throughout the codebase.
6//! For binaries that wish to use metrics, the intention is that an independent metrics
7//! process will run (main loop in the controller mod), and receive requests via a tube from
8//! another process.
9//!
10//! At head, metrics requests are ignored. However, a branching codebase can choose to implement
11//! their own handler which processes and uploads metrics requests as it sees fit, by setting the
12//! appropriate RequestHandler.
13
14mod controller;
15mod local_stats;
16pub mod sys;
17
18pub use controller::MetricsController;
19pub use metrics_events::MetricEventType;
20pub use metrics_product::*;
21
22pub type RequestHandler = MetricsRequestHandler;
23
24pub use local_stats::collect_scoped_byte_latency_stat;
25pub use local_stats::timed_scope;
26pub use local_stats::BytesLatencyStats;
27pub use local_stats::CallOnDrop;
28pub use local_stats::DetailedHistogram;
29pub use local_stats::GetStatsForOp;
30pub use local_stats::Histogram;
31pub use local_stats::Limits;
32pub use local_stats::NumberType;
33pub use local_stats::SimpleStat;
34pub use local_stats::SummaryStats;