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

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: Added tests for NotAcceptingTransform histogram and fixed unittest hitting new NOTREACHED check 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 15e9b941c19b8c38d172fb0ed3637c356e44e9ca..1e523a3d22d067ebdd3fcbf965c77d31f17ef570 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,17 +1084,30 @@ 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;
}
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