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

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

Issue 1127893002: Add DataReductionProxyExperimentsStats and UMA for measuring potentially non-compressed bytes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failures Created 5 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_network_delegate.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
index 9a66acdfb74cdbd81f0fee8cb1e945a0effbc4f4..706f1729d545ddddcb4a06db53137923cb5ded05 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
@@ -12,6 +12,7 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_experiments_stats.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
@@ -76,7 +77,8 @@ DataReductionProxyNetworkDelegate::DataReductionProxyNetworkDelegate(
scoped_ptr<net::NetworkDelegate> network_delegate,
DataReductionProxyConfig* config,
DataReductionProxyRequestOptions* request_options,
- const DataReductionProxyConfigurator* configurator)
+ const DataReductionProxyConfigurator* configurator,
+ DataReductionProxyExperimentsStats* experiments_stats)
: LayeredNetworkDelegate(network_delegate.Pass()),
received_content_length_(0),
original_content_length_(0),
@@ -84,9 +86,11 @@ DataReductionProxyNetworkDelegate::DataReductionProxyNetworkDelegate(
data_reduction_proxy_bypass_stats_(nullptr),
data_reduction_proxy_request_options_(request_options),
data_reduction_proxy_io_data_(nullptr),
- configurator_(configurator) {
+ configurator_(configurator),
+ experiments_stats_(experiments_stats) {
DCHECK(data_reduction_proxy_config_);
DCHECK(data_reduction_proxy_request_options_);
+ DCHECK(experiments_stats_);
}
DataReductionProxyNetworkDelegate::~DataReductionProxyNetworkDelegate() {
@@ -185,6 +189,9 @@ void DataReductionProxyNetworkDelegate::OnCompletedInternal(
RecordContentLengthHistograms(received_content_length,
original_content_length,
freshness_lifetime);
+ experiments_stats_->RecordBytes(request->request_time(), request_type,
+ received_content_length,
+ original_content_length);
if (data_reduction_proxy_io_data_ && data_reduction_proxy_bypass_stats_) {
data_reduction_proxy_bypass_stats_->RecordBytesHistograms(

Powered by Google App Engine
This is Rietveld 408576698