| // Copyright 2020 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.legacymetrics; |
| |
| /// 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 |
| @discoverable |
| closed protocol MetricsRecorder { |
| /// 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. |
| strict Record(struct { |
| events vector<Event>:MAX; |
| }) -> (); |
| |
| /// 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. |
| strict -> OnCloseSoon(); |
| }; |