metrics_generic/
client.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
5use base::RawDescriptor;
6use base::SendTube;
7use metrics_events::MetricEventType;
8use metrics_events::RecordDetails;
9
10use crate::MetricsClientDestructor;
11
12/// This interface exists to be used and re-implemented by downstream forks. Updates shouldn't be
13/// done without ensuring they won't cause breakages in dependent codebases.
14pub fn initialize(_: SendTube) {}
15#[cfg(test)]
16pub fn force_initialize(_: SendTube) {}
17
18pub fn push_descriptors(_: &mut Vec<RawDescriptor>) {}
19
20pub fn get_destructor() -> MetricsClientDestructor {
21    MetricsClientDestructor::new(|| {})
22}
23pub fn is_initialized() -> bool {
24    false
25}
26pub fn set_auth_token(_: &str) {}
27pub fn set_graphics_api(_: &str) {}
28pub fn set_package_name(_: &str) {}
29pub fn merge_session_invariants(_: &[u8]) {}
30
31/// Logs a counter with the given descriptor as aux. data. A descriptor is
32/// generally an enum value or error code.
33pub fn log_descriptor(_event_type: MetricEventType, _descriptor: i64) {}
34
35/// Logs a counter with no aux. data.
36pub fn log_event(_event_type: MetricEventType) {}
37
38/// Logs a real valued metric (e.g. a data transfer rate, a latency value, etc)
39/// with the supplied value.
40pub fn log_metric(_event_type: MetricEventType, _value: i64) {}
41
42/// Logs a real valued metric (e.g. a data transfer rate, a latency value, etc)
43/// with the supplied value & product specific extra details.
44pub fn log_metric_with_details(_: MetricEventType, _: i64, _: &RecordDetails) {}
45
46/// Logs a histogram metric with the supplied value. Note: step is a value to
47/// be added to the distribution.
48pub fn log_histogram_metric(_event_type: MetricEventType, _step: i64) {}
49
50/// Logs a high frequency counter with the supplied aux. data and value.
51pub fn log_high_frequency_descriptor_event(_: MetricEventType, _descriptor: i64, _step: i64) {}
52
53/// Logs a counter with additional data.
54pub fn log_event_with_details(_event_type: MetricEventType, _details: &RecordDetails) {}