1// Copyright 2021 The Chromium Authors 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5module metrics.structured.mojom; 6 7import "mojo/public/mojom/base/time.mojom"; 8 9/* 10 * Events to be recorded by StructuredMetrics. All values will be unhashed to be 11 * validated once received by the service. 12 * 13 * Next version: 2 14 */ 15[Stable] 16struct Event { 17 string project_name@0; 18 19 string event_name@1; 20 21 // Map containing metric name to its value. These should be consistent with 22 // definitions in structured.xml. 23 map<string, MetricValue> metrics@2; 24 25 // Time passed (in microseconds) since boot time. This is a timestamp 26 // that gets converted to system uptime before upload when the Event 27 // is passed from a WebUI Renderer process. 28 [MinVersion=1] mojo_base.mojom.TimeDelta? system_uptime@3; 29 30 // Whether this event is part of a sequence. 31 [MinVersion=1] bool is_event_sequence@4; 32}; 33 34[Stable] 35union MetricValue { 36 string hmac_value; 37 int64 long_value; 38 int32 int_value; 39 double double_value; 40 string raw_str_value; 41 bool bool_value; 42}; 43