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

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

Issue 2804113004: Add UMA to break down data usage by http/https and video/non_video (Closed)
Patch Set: Created 3 years, 8 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
« .gn ('K') | « .gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b36fd93d5ee321020b87c31dd20c128ac4ca1e5c..a6a4fc52d6d1454658d0fa6a0baaa8ed8b87a30f 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
@@ -24,6 +24,7 @@
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_util.h"
#include "components/data_reduction_proxy/core/common/lofi_decider.h"
#include "net/base/load_flags.h"
+#include "net/base/mime_util.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/nqe/effective_connection_type.h"
@@ -48,6 +49,8 @@ namespace {
// |freshness_lifetime| contains information on how long the resource will be
// fresh for and how long is the usability.
void RecordContentLengthHistograms(bool lofi_low_header_added,
+ bool is_https_request,
+ bool is_video,
int64_t received_content_length,
int64_t original_content_length,
const base::TimeDelta& freshness_lifetime) {
@@ -77,6 +80,14 @@ void RecordContentLengthHistograms(bool lofi_low_header_added,
original_content_length = received_content_length;
}
UMA_HISTOGRAM_COUNTS("Net.HttpContentLength", received_content_length);
+ if (is_https_request) {
+ UMA_HISTOGRAM_COUNTS("Net.HttpContentLength.Https", received_content_length);
sclittle 2017/04/07 20:07:34 style nit: 80 column limit, you can just run 'git
ajo1 2017/04/07 23:52:32 Done.
+ } else {
+ UMA_HISTOGRAM_COUNTS("Net.HttpContentLength.Http", received_content_length);
+ }
+ if (is_video) {
+ UMA_HISTOGRAM_COUNTS("Net.HttpContentLength.Video", received_content_length);
+ }
UMA_HISTOGRAM_COUNTS("Net.HttpOriginalContentLength",
original_content_length);
UMA_HISTOGRAM_COUNTS("Net.HttpContentLengthDifference",
@@ -418,12 +429,22 @@ void DataReductionProxyNetworkDelegate::RecordContentLength(
->GetFreshnessLifetimes(request.response_info().response_time)
.freshness;
+ bool is_https_request = request.url().SchemeIs("https");
+ bool is_video_request = false;
+ if (request.response_headers()) {
+ std::string mime_type;
+ request.response_headers()->GetMimeType(&mime_type);
+ is_video_request = net::MatchesMimeType("video/*", mime_type);
+ }
+
RecordContentLengthHistograms(
// |data_reduction_proxy_io_data_| can be NULL for Webview.
data_reduction_proxy_io_data_ &&
data_reduction_proxy_io_data_->IsEnabled() &&
data_reduction_proxy_io_data_->lofi_decider() &&
data_reduction_proxy_io_data_->lofi_decider()->IsUsingLoFi(request),
+ is_https_request,
+ is_video_request,
request.received_response_content_length(), original_content_length,
freshness_lifetime);
« .gn ('K') | « .gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698