• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2017 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
10package ukm;
11
12import "ukm/aggregate.proto";
13import "ukm/entry.proto";
14import "ukm/source.proto";
15import "ukm/web_features.proto";
16import "chrome_user_metrics_extension.proto";
17import "system_profile.proto";
18import "user_demographics.proto";
19
20// This is the message type sent from Chrome to the UKM collector.
21// Next tag: 15
22message Report {
23  // A unique identifier for a Chrome install. This ID should be used only
24  // in UKM reports, and not linked to any other data sources.
25  optional fixed64 client_id = 1;
26
27  // The product corresponding to this log. Note: The default value is Chrome,
28  // so Chrome products will not transmit this field.
29  optional metrics.ChromeUserMetricsExtension.Product product = 12
30      [default = CHROME];
31
32  // The session id for this record. This id is unique within a
33  // particular Chrome session. The client keeps track of the session id
34  // and sends it with each record. The session id is simply an integer
35  // that is incremented each time the user relaunches Chrome.
36  optional int32 session_id = 5;
37
38  // The report id for this record.  Report ids increase sequentially from
39  // one within a session.
40  optional int32 report_id = 6;
41
42  // Indicates that recording was continuously enabled for the period of time
43  // captured in this report.
44  optional bool is_continuous = 8;
45
46  enum LogRotationReason {
47    UNKNOWN = 0;
48    SCHEDULED_ROTATION = 1;
49    BACKGROUNDED = 2;
50    SHUTDOWN = 3;
51  }
52  optional LogRotationReason log_rotation_reason = 9;
53
54  // Information about the user's browser and system configuration.
55  optional metrics.SystemProfileProto system_profile = 2;
56
57  // The user's demographic information that consists of their noised birth year
58  // and gender. This data is made available to Chrome via syncable priority
59  // pref, so is only available if the user is signed-in and syncing.
60  optional metrics.UserDemographicsProto user_demographics = 11;
61
62  // A list of the top-level navigations that data was collected for.
63  repeated Source sources = 3;
64
65  // Counts of different types of sources in this interval, including sources
66  // which may not be in the report due to dropping or deferral.
67  message SourceCounts {
68    // Number of unique sources that URLs were observed for. This counts
69    // includes sources which were dropped or deferred, but not sources
70    // carried over from a previous interval.
71    optional int32 observed = 1;
72    // Number of navigation sources that URLs were observed for, including
73    // sources dropped due to limits.
74    optional int32 navigation_sources = 2;
75    // Number of sources discarded due to not matching a navigation URL.
76    optional int32 unmatched_sources = 3;
77    // Number of sources deferred from a previous interval.
78    optional int32 carryover_sources = 4;
79    // Number of sources deferred to the next interval. Sources corresponding to
80    // opened tabs that could emit more events in the future are kept in memory
81    // and deferred to the next interval for inclusion in next reports, up to a
82    // max limit on number of sources.
83    optional int32 deferred_sources = 5;
84    // Number of sources deferred to the next interval due to lack of events.
85    optional int32 entryless_sources = 6;
86    // Time elapsed in seconds from the moment the newest truncated source was
87    // created to the moment it was discarded from memory, if pruning happened
88    // due to number of sources exceeding the max threshold.
89    optional int32 pruned_sources_age_seconds = 7;
90  }
91  optional SourceCounts source_counts = 10;
92
93  // List of Entries containing the main UKM data.
94  repeated Entry entries = 4;
95  // Web features used on pages during this reporting interval.
96  repeated HighLevelWebFeatures web_features = 13;
97  // List of Entries containing aggregated UKM data.
98  repeated Aggregate aggregates = 7;
99
100  message DownsamplingRate {
101    // Hash of the event name to identify the event type. This field should
102    // always be set when any other field in this message is set.
103    optional fixed64 event_hash = 1;
104    // Rate computed by standard UKM downsampling.
105    // A value of N means that this event type is downsampled at a rate of
106    // 1-in-N, meaning this event type is only recorded for every 1 in N page
107    // loads. Unset means that the user didn't receive a parameter to
108    // downsample this event when events are collected in this reporting
109    // interval, thus no downsampling is applied.
110    optional uint32 standard_rate = 2;
111    // Any other further downsampling logic by custom client-side
112    // implementation.
113    // A value of M means that this event type is downsampled at a rate of
114    // 1-in-M, in addition to the standard downsampling rate by the UKM infra at
115    // the page load level.
116    optional uint32 custom_rate = 3;
117  }
118
119  // TODO(yrsun): populated this field, and add the milestone number when this
120  // is available for querying here.
121  repeated DownsamplingRate downsampling_rates = 14;
122}
123