Google is committed to advancing racial equity for Black communities. See how.

fuchsia.legacymetrics

PROTOCOLS

MetricsRecorder

Defined in fuchsia.legacymetrics/metrics_recorder.fidl

Accepts metrics events and uploads them to UMA servers for analysis. Metrics events are batched and uploaded at a regular interval. If this service is unable to upload events, it will try persisting them for later re-upload. For similar behavior, see Chromium's MetricsService: https://chromium.googlesource.com/chromium/src.git/+/refs/heads/master/components/metrics/metrics_service.cc

OnCloseSoon

Indicates that this service will close all connections soon. Upon receiving this event, each client should call Record() once for any available metrics and close its connection to this sevice. Otherwise, this service will close all incoming connections after a predefined timeout starting from the moment it broadcasts this event.

Response

NameType

Record

Processes and enqueues a batch of events for upload. Returns after the provided metrics are successfully processed by the service. Clients should wait for a completion callback before sending subsequent Record() requests.

Request

NameType
events vector<Event>

Response

NameType

STRUCTS

HistogramBucket

Defined in fuchsia.legacymetrics/event.fidl

NameTypeDescriptionDefault
min int64 No default
max int64 No default
count int64 No default

TABLES

Histogram

Defined in fuchsia.legacymetrics/event.fidl

OrdinalNameTypeDescription
1 name string

Required histogram identifier. See these guidelines for more info: https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md#naming-your-histogram

2 buckets vector<HistogramBucket>
3 sum int64

ImplementationDefinedEvent

Defined in fuchsia.legacymetrics/event.fidl

A custom event defined by the MetricsRecorder service. Refer to your MetricsRecorder implementation for more details on the payload structure.

OrdinalNameTypeDescription
1 data vector<uint8>

Custom binary payload whose structure is defined by the MetricsRecorder implementation. For example, it can represent a custom event protocol buffer serialized to its wire format.

2 name string

Event identifier required if it's not already included in binary data. This field takes precedence over any equivalent name included in binary data, if both are provided.

UserActionEvent

Defined in fuchsia.legacymetrics/event.fidl

Event that occurs in response to a user action. See https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/actions/README.md

OrdinalNameTypeDescription
1 name string
2 time zx/time

Required timestamp of the event occurrence. See TimeTicks in https://cs.chromium.org/chromium/src/base/time/time.h

UNIONS

Event

Defined in fuchsia.legacymetrics/event.fidl

A single metric event to be recorded and sent to the UMA backend.

NameTypeDescription
user_action_event UserActionEvent
histogram Histogram
impl_defined_event ImplementationDefinedEvent