• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 event_types;
16 mod metrics_cleanup;
17 mod metrics_requests;
18 mod noop;
19 mod sys;
20 pub mod protos {
21     // ANDROID: b/259142784 - we remove metrics_out subdir b/c cargo2android
22     include!(concat!(env!("OUT_DIR"), "/generated.rs"));
23 }
24 
25 pub use controller::MetricsController;
26 pub use event_types::MetricEventType;
27 pub use metrics_cleanup::MetricsClientDestructor;
28 pub use noop::*;
29 #[allow(unused_imports)]
30 pub use sys::*;
31 
32 pub type RequestHandler = NoopMetricsRequestHandler;
33