fuchsia.legacymetrics

Added: 7

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/+/HEAD/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

<EMPTY>

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

<EMPTY>

STRUCTS

HistogramBucket

Defined in fuchsia.legacymetrics/event.fidl

FieldTypeDescriptionDefault
min int64 No default
max int64 No default
count int64 No default

TABLES

Histogram

Defined in fuchsia.legacymetrics/event.fidl

OrdinalFieldTypeDescription
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

buckets vector<HistogramBucket>
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.

OrdinalFieldTypeDescription
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.

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

OrdinalFieldTypeDescription
name string
time zx/Time

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

UNIONS

Event strict

Defined in fuchsia.legacymetrics/event.fidl

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

OrdinalVariantTypeDescription
user_action_event UserActionEvent
histogram Histogram
impl_defined_event ImplementationDefinedEvent