xref: /aosp_15_r20/external/crosvm/metrics/src/lib.rs (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
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 
14 mod controller;
15 mod local_stats;
16 pub mod sys;
17 
18 pub use controller::MetricsController;
19 pub use metrics_events::MetricEventType;
20 pub use metrics_product::*;
21 
22 pub type RequestHandler = MetricsRequestHandler;
23 
24 pub use local_stats::collect_scoped_byte_latency_stat;
25 pub use local_stats::timed_scope;
26 pub use local_stats::BytesLatencyStats;
27 pub use local_stats::CallOnDrop;
28 pub use local_stats::DetailedHistogram;
29 pub use local_stats::GetStatsForOp;
30 pub use local_stats::Histogram;
31 pub use local_stats::Limits;
32 pub use local_stats::NumberType;
33 pub use local_stats::SimpleStat;
34 pub use local_stats::SummaryStats;
35