xref: /aosp_15_r20/external/crosvm/vendor/generic/metrics/src/lib.rs (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1 // Copyright 2024 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 //! Provides noop implementations of metrics interfaces, to be used by builds which don't wish
6 //! to log metrics.
7 
8 mod client;
9 mod periodic_logger;
10 mod request_handler;
11 
12 mod metrics_cleanup;
13 
14 use std::time::Duration;
15 
16 #[cfg(test)]
17 pub use client::force_initialize;
18 pub use client::get_destructor;
19 pub use client::initialize;
20 pub use client::is_initialized;
21 pub use client::log_descriptor;
22 pub use client::log_event;
23 pub use client::log_event_with_details;
24 pub use client::log_high_frequency_descriptor_event;
25 pub use client::log_histogram_metric;
26 pub use client::log_metric;
27 pub use client::merge_session_invariants;
28 pub use client::push_descriptors;
29 pub use client::set_auth_token;
30 pub use client::set_graphics_api;
31 pub use client::set_package_name;
32 pub use metrics_cleanup::MetricsClientDestructor;
33 pub use periodic_logger::PeriodicLogger;
34 pub use request_handler::MetricsRequestHandler;
35 
36 pub const METRICS_UPLOAD_INTERVAL: Duration = Duration::from_secs(60);
37