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

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

Issue 2956703002: Adds Server Previews protocol UMA plus UMA for not accepting previews (Closed)
Patch Set: Fix merge issue for unittest wrt AlwaysOn and PreviewsDecider 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
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
index 626d7940442965a9250f4f8905f7b2f7bf23fffa..7bef41ff2c2c42e96f9278188e967f6e7db4f609 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
@@ -54,6 +54,17 @@ using base::FieldTrialList;
namespace {
+// Values of the UMA DataReductionProxy.Protocol.NotAcceptingTransform histogram
+// defined in metrics/histograms/histograms.xml. This enum must remain
+// synchronized with DataReductionProxyProtocolNotAcceptingTransformReason in
+// tools/metrics/histograms/enums.xml.
+enum NotAcceptingTransformReason {
+ NOT_ACCEPTING_TRANSFORM_DISABLED = 0,
+ NOT_ACCEPTING_TRANSFORM_BLACKLISTED = 1,
+ NOT_ACCEPTING_TRANSFORM_CELLULAR_ONLY = 2,
+ NOT_ACCEPTING_TRANSFORM_REASON_BOUNDARY
+};
+
// Values of the UMA DataReductionProxy.NetworkChangeEvents histograms.
// This enum must remain synchronized with the enum of the same
// name in metrics/histograms/histograms.xml.
@@ -1073,7 +1084,11 @@ bool DataReductionProxyConfig::ShouldAcceptServerPreview(
// For the transition to server-driven previews decisions, we will
// use existing Lo-Fi flags for disabling and cellular-only mode.
// TODO(dougarnett): Refactor flag names as part of bug 725645.
- if (params::IsLoFiDisabledViaFlags()) {
+ if (params::IsLoFiDisabledViaFlags() || lofi_off()) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "DataReductionProxy.Protocol.NotAcceptingTransform",
+ NOT_ACCEPTING_TRANSFORM_DISABLED,
+ NOT_ACCEPTING_TRANSFORM_REASON_BOUNDARY);
return false;
}
@@ -1083,11 +1098,20 @@ bool DataReductionProxyConfig::ShouldAcceptServerPreview(
if (IsBlackListedOrDisabled(request, previews_decider,
previews::PreviewsType::LITE_PAGE)) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "DataReductionProxy.Protocol.NotAcceptingTransform",
+ NOT_ACCEPTING_TRANSFORM_BLACKLISTED,
+ NOT_ACCEPTING_TRANSFORM_REASON_BOUNDARY);
return false;
}
- if (params::IsLoFiCellularOnlyViaFlags()) {
- return net::NetworkChangeNotifier::IsConnectionCellular(connection_type_);
+ if (params::IsLoFiCellularOnlyViaFlags() &&
+ !net::NetworkChangeNotifier::IsConnectionCellular(connection_type_)) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "DataReductionProxy.Protocol.NotAcceptingTransform",
+ NOT_ACCEPTING_TRANSFORM_CELLULAR_ONLY,
+ NOT_ACCEPTING_TRANSFORM_REASON_BOUNDARY);
+ return false;
}
return true;

Powered by Google App Engine
This is Rietveld 408576698