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

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

Issue 2926683002: Add new OCL histograms (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc » ('j') | 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 a57e562e2730937253ef7df1814740487bdbaa7a..97fbec5be1c4da3b11c1ad2748edca409218e5df 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
@@ -13,6 +13,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
+#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#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"
@@ -57,13 +58,13 @@ void RecordNewContentLengthHistogram(const std::string& name, int64_t sample) {
}
void RecordNewContentLengthHistograms(
+ const char* prefix,
bool is_https,
bool is_video,
DataReductionProxyRequestType request_type,
- int64_t received_content_length) {
- std::string prefix = "Net.HttpContentLength";
- std::string connection_type = is_https ? ".Https" : ".Http";
- std::string suffix = ".Other";
+ int64_t content_length) {
+ const char* connection_type = is_https ? ".Https" : ".Http";
+ const char* suffix = ".Other";
// TODO(crbug.com/726411): Differentiate between a bypass and a disabled
// proxy config.
switch (request_type) {
@@ -84,11 +85,13 @@ void RecordNewContentLengthHistograms(
break;
}
// Record a histogram for all traffic, including video.
- RecordNewContentLengthHistogram(prefix + connection_type + suffix,
- received_content_length);
+ RecordNewContentLengthHistogram(
+ base::StringPrintf("%s%s%s", prefix, connection_type, suffix),
+ content_length);
if (is_video) {
RecordNewContentLengthHistogram(
- prefix + connection_type + suffix + ".Video", received_content_length);
+ base::StringPrintf("%s%s%s.Video", prefix, connection_type, suffix),
+ content_length);
}
}
@@ -135,8 +138,11 @@ void RecordContentLengthHistograms(bool lofi_low_header_added,
UMA_HISTOGRAM_COUNTS_1M("Net.HttpContentLength", received_content_length);
// Record the new histograms broken down by HTTP/HTTPS and video/non-video
- RecordNewContentLengthHistograms(is_https, is_video, request_type,
- received_content_length);
+ RecordNewContentLengthHistograms("Net.HttpContentLength", is_https, is_video,
+ request_type, received_content_length);
+ RecordNewContentLengthHistograms("Net.HttpOriginalContentLength", is_https,
+ is_video, request_type,
+ original_content_length);
UMA_HISTOGRAM_COUNTS_1M("Net.HttpOriginalContentLength",
original_content_length);
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698