Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h

Issue 2642553002: Adding UMA for data reduction proxy page load size/savings (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRICS_ OBSERVER_H_ 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRICS_ OBSERVER_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRICS_ OBSERVER_H_ 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRICS_ OBSERVER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 void OnFirstContentfulPaint( 83 void OnFirstContentfulPaint(
84 const page_load_metrics::PageLoadTiming& timing, 84 const page_load_metrics::PageLoadTiming& timing,
85 const page_load_metrics::PageLoadExtraInfo& info) override; 85 const page_load_metrics::PageLoadExtraInfo& info) override;
86 void OnFirstMeaningfulPaint( 86 void OnFirstMeaningfulPaint(
87 const page_load_metrics::PageLoadTiming& timing, 87 const page_load_metrics::PageLoadTiming& timing,
88 const page_load_metrics::PageLoadExtraInfo& info) override; 88 const page_load_metrics::PageLoadExtraInfo& info) override;
89 void OnParseStart(const page_load_metrics::PageLoadTiming& timing, 89 void OnParseStart(const page_load_metrics::PageLoadTiming& timing,
90 const page_load_metrics::PageLoadExtraInfo& info) override; 90 const page_load_metrics::PageLoadExtraInfo& info) override;
91 void OnParseStop(const page_load_metrics::PageLoadTiming& timing, 91 void OnParseStop(const page_load_metrics::PageLoadTiming& timing,
92 const page_load_metrics::PageLoadExtraInfo& info) override; 92 const page_load_metrics::PageLoadExtraInfo& info) override;
93 void OnLoadedResource(
94 const page_load_metrics::ExtraRequestInfo& extra_request_info) override;
93 95
94 private: 96 private:
95 // Sends the page load information to the pingback client. 97 // Sends the page load information to the pingback client.
96 void SendPingback(const page_load_metrics::PageLoadTiming& timing, 98 void SendPingback(const page_load_metrics::PageLoadTiming& timing,
97 const page_load_metrics::PageLoadExtraInfo& info); 99 const page_load_metrics::PageLoadExtraInfo& info);
98 100
101 // Record UMA of page size when the observer is about to be deleted.
102 void RecordPageSizeUMA();
tbansal1 2017/01/18 22:35:20 s/Record/Records/
RyanSturm 2017/01/18 22:57:49 Done.
103
99 // Gets the default DataReductionProxyPingbackClient. Overridden in testing. 104 // Gets the default DataReductionProxyPingbackClient. Overridden in testing.
100 virtual DataReductionProxyPingbackClient* GetPingbackClient() const; 105 virtual DataReductionProxyPingbackClient* GetPingbackClient() const;
101 106
102 // Data related to this navigation. 107 // Data related to this navigation.
103 std::unique_ptr<DataReductionProxyData> data_; 108 std::unique_ptr<DataReductionProxyData> data_;
104 109
105 // The browser context this navigation is operating in. 110 // The browser context this navigation is operating in.
106 content::BrowserContext* browser_context_; 111 content::BrowserContext* browser_context_;
107 112
113 // The number of requests that used data reduction proxy.
114 int num_data_reduction_proxy_requests_;
115
116 // The number of request that used the network.
tbansal1 2017/01/18 22:35:20 How is this determined? What happens if the cached
RyanSturm 2017/01/18 22:57:49 Done.
117 int num_network_requests_;
118
119 // The total content network bytes that the user would have downloaded if they
120 // were not using data reduction proxy.
121 int64_t original_network_bytes_;
122
123 // The total network bytes loaded through data reduction proxy
tbansal1 2017/01/18 22:35:20 missing period at end.
124 int64_t network_bytes_proxied_;
125
126 // The total network bytes used.
127 int64_t network_bytes_;
128
108 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyMetricsObserver); 129 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyMetricsObserver);
109 }; 130 };
110 131
111 } // namespace data_reduction_proxy 132 } // namespace data_reduction_proxy
112 133
113 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRI CS_OBSERVER_H_ 134 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRI CS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698