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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_metrics.cc

Issue 324503003: Report data reduction proxy related daily content lengths even if zero (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments. Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "components/data_reduction_proxy/browser/data_reduction_proxy_metrics.h " 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_metrics.h "
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/prefs/scoped_user_pref_update.h" 9 #include "base/prefs/scoped_user_pref_update.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 original_length_with_data_reduction_enabled; 105 original_length_with_data_reduction_enabled;
106 } 106 }
107 UMA_HISTOGRAM_PERCENTAGE( 107 UMA_HISTOGRAM_PERCENTAGE(
108 "Net.DailyContentSavingPercent_DataReductionProxyEnabled", 108 "Net.DailyContentSavingPercent_DataReductionProxyEnabled",
109 percent_data_reduction_proxy_enabled); 109 percent_data_reduction_proxy_enabled);
110 110
111 UMA_HISTOGRAM_PERCENTAGE( 111 UMA_HISTOGRAM_PERCENTAGE(
112 "Net.DailyContentPercent_DataReductionProxyEnabled", 112 "Net.DailyContentPercent_DataReductionProxyEnabled",
113 (100 * received_length_with_data_reduction_enabled) / received_length); 113 (100 * received_length_with_data_reduction_enabled) / received_length);
114 114
115 if (https_length_with_data_reduction_enabled > 0) { 115 DCHECK_GE(https_length_with_data_reduction_enabled, 0);
116 UMA_HISTOGRAM_COUNTS( 116 UMA_HISTOGRAM_COUNTS(
117 "Net.DailyContentLength_DataReductionProxyEnabled_Https", 117 "Net.DailyContentLength_DataReductionProxyEnabled_Https",
118 https_length_with_data_reduction_enabled >> 10); 118 https_length_with_data_reduction_enabled >> 10);
119 UMA_HISTOGRAM_PERCENTAGE( 119 UMA_HISTOGRAM_PERCENTAGE(
120 "Net.DailyContentPercent_DataReductionProxyEnabled_Https", 120 "Net.DailyContentPercent_DataReductionProxyEnabled_Https",
121 (100 * https_length_with_data_reduction_enabled) / received_length); 121 (100 * https_length_with_data_reduction_enabled) / received_length);
122 }
123 122
124 if (short_bypass_length_with_data_reduction_enabled > 0) { 123 DCHECK_GE(short_bypass_length_with_data_reduction_enabled, 0);
125 UMA_HISTOGRAM_COUNTS( 124 UMA_HISTOGRAM_COUNTS(
126 "Net.DailyContentLength_DataReductionProxyEnabled_ShortBypass", 125 "Net.DailyContentLength_DataReductionProxyEnabled_ShortBypass",
127 short_bypass_length_with_data_reduction_enabled >> 10); 126 short_bypass_length_with_data_reduction_enabled >> 10);
128 UMA_HISTOGRAM_PERCENTAGE( 127 UMA_HISTOGRAM_PERCENTAGE(
129 "Net.DailyContentPercent_DataReductionProxyEnabled_ShortBypass", 128 "Net.DailyContentPercent_DataReductionProxyEnabled_ShortBypass",
130 ((100 * short_bypass_length_with_data_reduction_enabled) / 129 ((100 * short_bypass_length_with_data_reduction_enabled) /
131 received_length)); 130 received_length));
132 }
133 131
134 if (long_bypass_length_with_data_reduction_enabled > 0) { 132 DCHECK_GE(long_bypass_length_with_data_reduction_enabled, 0);
135 UMA_HISTOGRAM_COUNTS( 133 UMA_HISTOGRAM_COUNTS(
136 "Net.DailyContentLength_DataReductionProxyEnabled_LongBypass", 134 "Net.DailyContentLength_DataReductionProxyEnabled_LongBypass",
137 long_bypass_length_with_data_reduction_enabled >> 10); 135 long_bypass_length_with_data_reduction_enabled >> 10);
138 UMA_HISTOGRAM_PERCENTAGE( 136 UMA_HISTOGRAM_PERCENTAGE(
139 "Net.DailyContentPercent_DataReductionProxyEnabled_LongBypass", 137 "Net.DailyContentPercent_DataReductionProxyEnabled_LongBypass",
140 ((100 * long_bypass_length_with_data_reduction_enabled) / 138 ((100 * long_bypass_length_with_data_reduction_enabled) /
141 received_length)); 139 received_length));
142 }
143 140
144 if (unknown_length_with_data_reduction_enabled > 0) { 141 DCHECK_GE(unknown_length_with_data_reduction_enabled, 0);
145 UMA_HISTOGRAM_COUNTS( 142 UMA_HISTOGRAM_COUNTS(
146 "Net.DailyContentLength_DataReductionProxyEnabled_Unknown", 143 "Net.DailyContentLength_DataReductionProxyEnabled_Unknown",
147 unknown_length_with_data_reduction_enabled >> 10); 144 unknown_length_with_data_reduction_enabled >> 10);
148 UMA_HISTOGRAM_PERCENTAGE( 145 UMA_HISTOGRAM_PERCENTAGE(
149 "Net.DailyContentPercent_DataReductionProxyEnabled_Unknown", 146 "Net.DailyContentPercent_DataReductionProxyEnabled_Unknown",
150 ((100 * unknown_length_with_data_reduction_enabled) / 147 ((100 * unknown_length_with_data_reduction_enabled) /
151 received_length)); 148 received_length));
152 }
153 149
154 if (original_length_via_data_reduction_proxy <= 0 || 150 DCHECK_GE(original_length_via_data_reduction_proxy, 0);
155 received_length_via_data_reduction_proxy <= 0) {
156 return;
157 }
158
159 UMA_HISTOGRAM_COUNTS( 151 UMA_HISTOGRAM_COUNTS(
160 "Net.DailyOriginalContentLength_ViaDataReductionProxy", 152 "Net.DailyOriginalContentLength_ViaDataReductionProxy",
161 original_length_via_data_reduction_proxy >> 10); 153 original_length_via_data_reduction_proxy >> 10);
154 DCHECK_GE(received_length_via_data_reduction_proxy, 0);
162 UMA_HISTOGRAM_COUNTS( 155 UMA_HISTOGRAM_COUNTS(
163 "Net.DailyContentLength_ViaDataReductionProxy", 156 "Net.DailyContentLength_ViaDataReductionProxy",
164 received_length_via_data_reduction_proxy >> 10); 157 received_length_via_data_reduction_proxy >> 10);
165 int percent_via_data_reduction_proxy = 0; 158 int percent_via_data_reduction_proxy = 0;
166 if (original_length_via_data_reduction_proxy > 159 if (original_length_via_data_reduction_proxy >
167 received_length_via_data_reduction_proxy) { 160 received_length_via_data_reduction_proxy) {
168 percent_via_data_reduction_proxy = 161 percent_via_data_reduction_proxy =
169 100 * (original_length_via_data_reduction_proxy - 162 100 * (original_length_via_data_reduction_proxy -
170 received_length_via_data_reduction_proxy) / 163 received_length_via_data_reduction_proxy) /
171 original_length_via_data_reduction_proxy; 164 original_length_via_data_reduction_proxy;
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 UpdateContentLengthPrefsForDataReductionProxy( 533 UpdateContentLengthPrefsForDataReductionProxy(
541 received_content_length, 534 received_content_length,
542 original_content_length, 535 original_content_length,
543 with_data_reduction_proxy_enabled, 536 with_data_reduction_proxy_enabled,
544 request_type, 537 request_type,
545 base::Time::Now(), 538 base::Time::Now(),
546 prefs); 539 prefs);
547 } 540 }
548 541
549 } // namespace data_reduction_proxy 542 } // namespace data_reduction_proxy
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698