| // Copyright 2016 The Chromium Authors. All rights reserved. | 
 | // Use of this source code is governed by a BSD-style license that can be | 
 | // found in the LICENSE file. | 
 |  | 
 | syntax = "proto2"; | 
 |  | 
 | option optimize_for = LITE_RUNTIME; | 
 |  | 
 | import "client_config.proto"; | 
 |  | 
 | package data_reduction_proxy; | 
 |  | 
 | // Information about the device the user is on. | 
 | message PageloadDeviceInfo { | 
 |   // Kilobytes of total device memory. | 
 |   optional int64 total_device_memory_kb = 1; | 
 | } | 
 |  | 
 | // Request message to record metrics for one or more pageloads. | 
 | message RecordPageloadMetricsRequest { | 
 |   // The pageload metrics to record. | 
 |   repeated PageloadMetrics pageloads = 1; | 
 |   // Time metrics were sent. | 
 |   optional Timestamp metrics_sent_time = 2; | 
 |  | 
 |   // Added in M65. | 
 |   optional PageloadDeviceInfo device_info = 3; | 
 | } | 
 |  | 
 | // Information about each network transaction used to load the main frame HTML. | 
 | message RequestInfo { | 
 |   enum Protocol { | 
 |     UNKNOWN = 0; | 
 |     HTTP = 1; | 
 |     HTTPS = 2; | 
 |     QUIC = 3; | 
 |   }; | 
 |  | 
 |   // The protocol used to connect to the Data Saver proxy. | 
 |   optional Protocol protocol = 1; | 
 |  | 
 |   // True if this request received a proxy bypass. | 
 |   optional bool proxy_bypass = 2; | 
 |  | 
 |   // Time to resolve DNS. e.g., to resolve proxy.googlezip.net. | 
 |   optional Duration dns_time = 3; | 
 |  | 
 |   // For TCP protocols, this is TCP connect + TLS setup. | 
 |   // For 1RTT QUIC, this is the QUIC connection time (which includes TLS). | 
 |   // For 0RTT QUIC (or TLS1.3 with fast-open), this will be zero. | 
 |   optional Duration connect_time = 4; | 
 |  | 
 |   // Time between sending the HTTP request and receiving the response. | 
 |   optional Duration http_time = 5; | 
 | } | 
 |  | 
 | // Metrics for a single pageload. | 
 | message PageloadMetrics { | 
 |   // Next ID: 22 | 
 |   reserved 3; | 
 |  | 
 |   // The possible effective connection type values. | 
 |   // See //net/nqe/effective_connection_type.h for the detailed description of | 
 |   // each of the enum values. | 
 |   enum EffectiveConnectionType { | 
 |     EFFECTIVE_CONNECTION_TYPE_UNKNOWN = 0; | 
 |     EFFECTIVE_CONNECTION_TYPE_OFFLINE = 1; | 
 |     EFFECTIVE_CONNECTION_TYPE_SLOW_2G = 2; | 
 |     EFFECTIVE_CONNECTION_TYPE_2G = 3; | 
 |     EFFECTIVE_CONNECTION_TYPE_3G = 4; | 
 |     EFFECTIVE_CONNECTION_TYPE_4G = 5; | 
 |   }; | 
 |  | 
 |   // The possible conntion type values. See //net/base/network_change_notifier.h | 
 |   // for a detailed description of the enum values. | 
 |   enum ConnectionType { | 
 |     CONNECTION_UNKNOWN = 0; | 
 |     CONNECTION_ETHERNET = 1; | 
 |     CONNECTION_WIFI = 2; | 
 |     CONNECTION_2G = 3; | 
 |     CONNECTION_3G = 4; | 
 |     CONNECTION_4G = 5; | 
 |     CONNECTION_NONE = 6; | 
 |     CONNECTION_BLUETOOTH = 7; | 
 |   }; | 
 |  | 
 |   // The various opt out states seen by server previews. | 
 |   enum PreviewsOptOut { | 
 |     // Set for non-previews navigations and app background navigations. | 
 |     UNKNOWN = 0; | 
 |     // Set for previews navigations that clicked "show original". | 
 |     OPT_OUT = 1; | 
 |     // Set for previews navigations that did not click "show original". | 
 |     NON_OPT_OUT = 2; | 
 |   } | 
 |  | 
 |   // The various server previews that can be shown. | 
 |   enum PreviewsType { | 
 |     // No server preview was applied, but the URL/navigation was not | 
 |     // blacklisted. | 
 |     NONE = 0; | 
 |     // Image placeholders were used on the page. | 
 |     LOFI = 1; | 
 |     // The main resource was a lite page. | 
 |     LITE_PAGE = 2; | 
 |     // Blacklisting rules caused no server preview to be requested. It's | 
 |     // possible in the future that client previews might be shown when server | 
 |     // previews are blacklisted, currently this is not possible. | 
 |     CLIENT_BLACKLIST_PREVENTED_PREVIEW = 3; | 
 |   } | 
 |  | 
 |   // What type of crash occured on the page. | 
 |   enum RendererCrashType { | 
 |     // Reserved default value. | 
 |     UNSPECIFIED = 0; | 
 |     // No renderer crash happened on the page. | 
 |     NO_CRASH = 1; | 
 |     // A crash occured on the page, but the type is unknown. This is reported | 
 |     // for all non-Android crashes and Android crashes that did not have their | 
 |     // crash dump analyzed within 5 seconds of the crash. | 
 |     NOT_ANALYZED = 2; | 
 |     // Any other Android crash where the dump was successfully analyzed. | 
 |     OTHER_CRASH = 3; | 
 |     // A crash where the renderer ran out of memory on the page. | 
 |     ANDROID_FOREGROUND_OOM = 4; | 
 |   } | 
 |  | 
 |   // The session key used to load the page. | 
 |   optional string session_key = 1; | 
 |   // The time at which the first request of the pageload was made, according to | 
 |   // the client's clock. | 
 |   optional Timestamp first_request_time = 2; | 
 |   // The URL of the main page request. | 
 |   optional string first_request_url = 4; | 
 |   // The URL of the last request. | 
 |   optional string last_request_url = 5; | 
 |  | 
 |   // Time to first contentful paint. | 
 |   optional Duration time_to_first_contentful_paint = 6; | 
 |   // Time to first image paint. | 
 |   optional Duration time_to_first_image_paint = 7; | 
 |   // Time to first byte. | 
 |   optional Duration time_to_first_byte = 8; | 
 |   // Time to onLoad event. | 
 |   optional Duration page_load_time = 9; | 
 |  | 
 |   // The sum of original-content-length values, over resources that were not | 
 |   // loaded from browser cache. | 
 |   // Secure resources (i.e., HTTPS) that go into this sum are bucketed. | 
 |   optional int64 original_page_size_bytes = 10; | 
 |   // The sum of (compressed) content-length, over resources that were not loaded | 
 |   // from browser cache. | 
 |   // Secure resources (i.e., HTTPS) that go into this sum are bucketed. | 
 |   optional int64 compressed_page_size_bytes = 11; | 
 |  | 
 |   // The effective connection type at the start of the navigation. | 
 |   optional EffectiveConnectionType effective_connection_type = 12; | 
 |  | 
 |   // The amount of time the parser was blocked by loading script. | 
 |   optional Duration parse_blocked_on_script_load_duration = 13; | 
 |  | 
 |   // Time until parsing finished. | 
 |   optional Duration parse_stop = 14; | 
 |  | 
 |   // Time to first meaningful paint. This measure is unstable and will change | 
 |   // over time. | 
 |   optional Duration experimental_time_to_first_meaningful_paint = 15; | 
 |  | 
 |   // The unique identifier for the page load. | 
 |   optional uint64 page_id = 16; | 
 |  | 
 |   // The opt out state of the page load. | 
 |   optional PreviewsOptOut previews_opt_out = 17; | 
 |  | 
 |   // The previews type that was used on the page. | 
 |   optional PreviewsType previews_type = 18; | 
 |  | 
 |   // The name of the finch group for the data reduction proxy holdback | 
 |   // experiment. This can be an empty string if not included in a finch group. | 
 |   optional string holdback_group = 19; | 
 |  | 
 |   // Kilobytes of memory used by the main renderer process related to this page | 
 |   // load. Recorded after load event starts. 0 if the page closed before or | 
 |   // shortly after load event or the memory dump failed. | 
 |   // Out of process frames will not be tracked in this estimate. | 
 |   optional int64 renderer_memory_usage_kb = 20; | 
 |  | 
 |   // The RendererCrashType for the page load. | 
 |   optional RendererCrashType renderer_crash_type = 21; | 
 |  | 
 |   // The percent of total_page_size_bytes that were loaded from the cache. This | 
 |   // value is in the range [0.0, 1.0]. | 
 |   optional float cached_fraction = 22; | 
 |  | 
 |   // The connection type (Wifi, 2G, 3G, 4G, None, etc) reported by the | 
 |   // NetworkChangeNotifier. | 
 |   optional ConnectionType connection_type = 23; | 
 |  | 
 |   // The sum of all bytes loaded on a page. This is compressed_page_size_bytes | 
 |   // plus the sum of content-length for all resources loaded from the browser | 
 |   // cache. Secure resources (i.e., HTTPS) that go into this sum are bucketed. | 
 |   optional int64 total_page_size_bytes = 24; | 
 |  | 
 |   // The queuing delay for the first user input on the page. | 
 |   optional Duration first_input_delay = 25; | 
 |  | 
 |   // Connection timing information for each network transaction to load the main | 
 |   // frame HTML. If the main frame HTML was reached after N redirects, then this | 
 |   // array has N+1 values. In most cases we expect this will have 1 value. The | 
 |   // first value is the original request and each following value is the next | 
 |   // redirect in order. | 
 |   repeated RequestInfo main_frame_network_request = 26; | 
 | } |