From 2e24140d8b60de1661544019d74ad87ed386c03c Mon Sep 17 00:00:00 2001 From: Noah Gold Date: Fri, 31 May 2024 18:10:39 +0000 Subject: [PATCH] vendor/generic/metrics: document API methods. BUG=b:331214555 TEST=presubmit Change-Id: Iaa5db4b4e30d981848ccdac9966b51cf826d2518 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5588285 Commit-Queue: Noah Gold Reviewed-by: Daniel Verkamp --- vendor/generic/metrics/src/client.rs | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/vendor/generic/metrics/src/client.rs b/vendor/generic/metrics/src/client.rs index f7e691ac9a..da41ffbd8a 100644 --- a/vendor/generic/metrics/src/client.rs +++ b/vendor/generic/metrics/src/client.rs @@ -27,9 +27,24 @@ pub fn set_auth_token(_: &str) {} pub fn set_graphics_api(_: &str) {} pub fn set_package_name(_: &str) {} pub fn merge_session_invariants(_: &[u8]) {} -pub fn log_descriptor(_: MetricEventType, _: i64) {} -pub fn log_event(_: MetricEventType) {} -pub fn log_metric(_: MetricEventType, _: i64) {} -pub fn log_histogram_metric(_: MetricEventType, _: i64) {} -pub fn log_high_frequency_descriptor_event(_: MetricEventType, _: i64, _: i64) {} -pub fn log_event_with_details(_: MetricEventType, _: &RecordDetails) {} + +/// Logs a counter with the given descriptor as aux. data. A descriptor is +/// generally an enum value or error code. +pub fn log_descriptor(_event_type: MetricEventType, _descriptor: i64) {} + +/// Logs a counter with no aux. data. +pub fn log_event(_event_type: MetricEventType) {} + +/// Logs a real valued metric (e.g. a data transfer rate, a latency value, etc) +/// with the supplied value. +pub fn log_metric(_event_type: MetricEventType, _value: i64) {} + +/// Logs a histogram metric with the supplied value. Note: step is a value to +/// be added to the distribution. +pub fn log_histogram_metric(_event_type: MetricEventType, _step: i64) {} + +/// Logs a high frequency counter with the supplied aux. data and value. +pub fn log_high_frequency_descriptor_event(_: MetricEventType, _descriptor: i64, _step: i64) {} + +/// Logs a counter with additional data. +pub fn log_event_with_details(_event_type: MetricEventType, _details: &RecordDetails) {}