1// Copyright 2014 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 5syntax = "proto2"; 6 7option optimize_for = LITE_RUNTIME; 8option java_package = "org.chromium.components.metrics"; 9 10option java_outer_classname = "ChromeUserMetricsExtensionProtos"; 11 12package metrics; 13 14import "cast_logs.proto"; 15import "chrome_os_app_list_launch_event.proto"; 16import "custom_tab_session.proto"; 17import "histogram_event.proto"; 18import "omnibox_event.proto"; 19 20import "printer_event.proto"; 21import "reporting_info.proto"; 22import "sampled_profile.proto"; 23import "structured_data.proto"; 24import "system_profile.proto"; 25import "trace_log.proto"; 26import "translate_event.proto"; 27import "user_action_event.proto"; 28import "user_demographics.proto"; 29 30// Next tag: 29 31message ChromeUserMetricsExtension { 32 // The product (i.e. end user application) for a given UMA log. 33 enum Product { 34 // Google Chrome product family. 35 CHROME = 0; 36 37 // UMA metrics from Android Webview. 38 ANDROID_WEBVIEW = 20; 39 40 // Cast Assistant 41 CAST_ASSISTANT = 25; 42 43 // Cast receivers, e.g. Chromecast 44 CAST = 35; 45 46 // UMA metrics from Android WebLayer. 47 ANDROID_WEBLAYER = 56; 48 } 49 // The product corresponding to this log. The field type is int32 instead of 50 // Product so that downstream users of the Chromium metrics component can 51 // introduce products without needing to make changes to the Chromium code 52 // (though they still need to add the new product to the server-side enum). 53 // Note: The default value is Chrome, so Chrome products will not transmit 54 // this field. 55 optional int32 product = 10 [default = 0]; 56 57 // The id of the client install that generated these events. 58 // 59 // For Chrome clients, this id is unique to a top-level (one level above the 60 // "Default" directory) Chrome user data directory [1], and so is shared among 61 // all Chrome user profiles contained in this user data directory. 62 // This client_id may not be unique across platforms. Notably, ChromeOS and 63 // Lacros are different platforms yet report the same client_id for the same 64 // device. 65 // An id of 0 is reserved for test data (monitoring and internal testing) and 66 // should normally be ignored in analysis of the data. 67 // [1] http://www.chromium.org/user-experience/user-data-directory 68 optional fixed64 client_id = 1; 69 70 // The session id for this user. 71 // Values such as tab ids are only meaningful within a particular session. 72 // The client keeps track of the session id and sends it with each event. 73 // The session id is simply an integer that is incremented each time the user 74 // relaunches Chrome. 75 optional int32 session_id = 2; 76 77 // The id associated with a user entity that generated these events. These 78 // user IDs are only associated with users on device. Their generation is not 79 // based on any other ID. 80 // 81 // This field is not populated on non-Chrome OS platforms. 82 // 83 // For Chrome OS, this id refers to a device user entity. This field will be 84 // captured when a log is first opened. If there is no user logged in at the 85 // time the log is opened, then this field will be unset. All ephemeral (i.e. 86 // guest, kiosk) users will have this field unset. 87 optional fixed64 user_id = 24; 88 89 // A client-managed id that functions as a sequence number for the log record. 90 // Clients are expected to maintain a counter, incrementing it (by 1) for each 91 // record they create, and populate this field. Each record_id is expected to 92 // be unique when scoped to a given client_id. It is further expected that the 93 // record_id values associated to a given client_id form an uninterrupted 94 // numeric sequence (i.e. k, k+1, k+2, k+3, ...), allowing for the detection 95 // of dropped, or otherwise lost, records. 96 optional int64 record_id = 28; 97 98 // Next tag: 4 99 message RealLocalTime { 100 // The source of the timestamp. 101 enum TimeSource { 102 UNSPECIFIED = 0; 103 // The time on the local machine. 104 CLIENT_CLOCK = 1; 105 106 // The time derived from server information provided by the 107 // NetworkTimeTracker a.k.a. "sane time" system. See 108 // https://www.chromium.org/developers/design-documents/sane-time 109 NETWORK_TIME_CLOCK = 2; 110 } 111 112 optional TimeSource time_source = 1; 113 114 // |time_sec| is in seconds since epoch. 115 optional int64 time_sec = 2; 116 117 // |time_zone_offset_from_gmt_sec| is in seconds. 118 // Only logged in |time_log_closed| entries, not |time_log_created| entries. 119 // (Populating this field when creating a log slows down startup too much.) 120 optional int32 time_zone_offset_from_gmt_sec = 3; 121 } 122 123 // These times are set for "ongoing" UMA logs. For two other types 124 // of UMA logs, these values are omitted: 125 // - logs recovered from a previous run of Chrome ("persisted UMA"), such as 126 // one that didn't shut down cleanly. 127 // - the initial stability log. 128 // 129 // Warning: in some cases |time_log_created| can contain events that happened 130 // slightly before this timestamp. If you only care about differences of more 131 // than a minute, you can skip reading this section. In particular, at the 132 // time of writing, the "initial metric log" includes all metrics from startup 133 // until it is closed, which happens 60 seconds after startup on desktop 134 // platforms and 15 seconds after startup on mobile platforms. (See 135 // components/metrics/metrics_scheduler.cc kInitialIntervalSeconds.) Yet, the 136 // initial metrics log is only created 30 seconds after startup on desktop 137 // platforms and 5 seconds after startup on mobile platforms. (See 138 // components/metrics/metrics_service.cc kInitializationDelaySeconds.) This 139 // means histograms that are stored in a record could have been emitted up to 140 // 30 seconds before the log was created. This logic may change in the 141 // future; see http://crbug.com/1171830 142 optional RealLocalTime time_log_created = 25; 143 optional RealLocalTime time_log_closed = 26; 144 145 // Information about the user's browser and system configuration. 146 optional SystemProfileProto system_profile = 3; 147 148 // The user's demographic information. This data is made available to Chrome 149 // via syncable priority pref, so is only available if the user is signed-in 150 // and syncing. 151 optional UserDemographicsProto user_demographics = 21; 152 153 // This message will log one or more of the following event types: 154 repeated UserActionEventProto user_action_event = 4; 155 repeated OmniboxEventProto omnibox_event = 5; 156 repeated HistogramEventProto histogram_event = 6; 157 158 repeated TranslateEventProto translate_event = 15; 159 repeated PrinterEventProto printer_event = 16; 160 repeated ChromeOSAppListLaunchEventProto chrome_os_app_list_launch_event = 20; 161 162 optional StructuredDataProto structured_data = 23; 163 164 // A list of all collected sample-based profiles since the last UMA upload. 165 repeated SampledProfile sampled_profile = 11; 166 167 // Additional data related with Cast-enabled devices. 168 optional CastLogsProto cast_logs = 12; 169 170 // The ReportingInfo message sent in the X-Chrome-UMA-ReportingInfo header. 171 // Copied in by the receiving server. 172 optional ReportingInfo reporting_info = 17; 173 174 // The Chrome traces obtained during the current session. The start time, 175 // duration and details depend on the experiment triggers in the current 176 // session. This field is uploaded as independent logs, which contain only 177 // session id and core system profile fields, apart from this field. 178 repeated TraceLog trace_log = 19; 179 180 // Information about a Custom Tabs session, recorded in the log when the 181 // a CCT session ended. If custom tabs are opened and closed multiple times 182 // within the same log session, only the last one will be recorded. This is 183 // used to identify applications that use Custom Tabs in an abusive way. This 184 // is specific to Android. 185 optional CustomTabSessionProto custom_tab_session = 27; 186} 187