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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc

Issue 2019783002: Add histograms for requests that were fetched successfully (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed sclittle, asvitkine comments Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
index 45858bb44dbf8ec66c98bef8af11bba82dd98632..a06f4d2317d8a7c27329e59a0b74ecadadb1db20 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
@@ -118,16 +118,27 @@ DataReductionProxyBypassStats::~DataReductionProxyBypassStats() {
void DataReductionProxyBypassStats::OnUrlRequestCompleted(
const net::URLRequest* request, bool started) {
+ DataReductionProxyTypeInfo proxy_info;
// Ignore requests that did not use the data reduction proxy. The check for
// LOAD_BYPASS_PROXY is necessary because the proxy_server() in the |request|
// might still be set to the data reduction proxy if |request| was retried
// over direct and a network error occurred while retrying it.
if (data_reduction_proxy_config_->WasDataReductionProxyUsed(request,
- nullptr) &&
+ &proxy_info) &&
(request->load_flags() & net::LOAD_BYPASS_PROXY) == 0 &&
request->status().status() == net::URLRequestStatus::SUCCESS) {
successful_requests_through_proxy_count_++;
NotifyUnavailabilityIfChanged();
+
+ // Report the success counts.
+ UMA_HISTOGRAM_COUNTS_100(
+ "DataReductionProxy.SuccessfulRequestCompletionCounts",
+ proxy_info.proxy_index);
+ if (request->load_flags() & net::LOAD_MAIN_FRAME) {
+ UMA_HISTOGRAM_COUNTS_100(
+ "DataReductionProxy.SuccessfulRequestCompletionCounts.MainFrame",
+ proxy_info.proxy_index);
+ }
}
}
@@ -171,7 +182,7 @@ void DataReductionProxyBypassStats::OnProxyFallback(
NotifyUnavailabilityIfChanged();
}
- if (!data_reduction_proxy_info.is_fallback) {
+ if (data_reduction_proxy_info.proxy_index == 0) {
RecordDataReductionProxyBypassInfo(
true, false, bypassed_proxy, BYPASS_EVENT_TYPE_NETWORK_ERROR);
RecordDataReductionProxyBypassOnNetworkError(

Powered by Google App Engine
This is Rietveld 408576698