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

Unified Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h

Issue 111113006: Metrics fix for data reduction proxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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: chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h b/chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h
index 7178da6cafeedc4a5f47d31ecbe9dbd5277904f3..e8b1f44eb5da5d482c4dfcdfc8cd4e3a31da3c9c 100644
--- a/chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h
@@ -37,6 +37,39 @@ const unsigned int kNumDaysInHistorySummary = 30;
COMPILE_ASSERT(kNumDaysInHistorySummary <= kNumDaysInHistory,
DataReductionProxySettings_summary_too_long);
+ // Values of the UMA DataReductionProxy.StartupState histogram.
bengr 2014/01/02 17:30:40 Must this enum stay in sync with something in hist
marq (ping after 24h) 2014/01/02 20:45:47 Done.
+ enum ProxyStartupState {
+ PROXY_NOT_AVAILABLE = 0,
+ PROXY_DISABLED,
+ PROXY_ENABLED,
+ PROXY_STARTUP_STATE_COUNT,
+ };
+
+ // Values of the UMA DataReductionProxy.ProbeURL histogram.
+ // This enum must remain synchronized with DataReductionProxyProbeURLFetchResult
bengr 2014/01/02 17:30:40 > 80 characters
marq (ping after 24h) 2014/01/02 20:45:47 Done.
+ // in metrics/histograms/histograms.xml.
+ // These names are misleading -- for 'DISABLED', read 'RESTRICTED'.
bengr 2014/01/02 17:30:40 Why aren't we just changing these to 'RESTRICTED'
marq (ping after 24h) 2014/01/02 20:45:47 Mostly because I didn't want to propagate the rena
bengr 2014/01/06 16:51:23 Please add a TODO to rename.
+ enum ProbeURLFetchResult {
+ // The probe failed because the internet was disconnected.
+ INTERNET_DISCONNECTED = 0,
+
+ // The probe failed for any other reason, and as a result, the proxy was
+ // disabled.
+ FAILED_PROXY_DISABLED,
+
+ // The probe failed, but the proxy was already restricted.
+ FAILED_PROXY_ALREADY_DISABLED,
+
+ // THe probe succeeded, and as a result the proxy was restricted.
+ SUCCEEDED_PROXY_ENABLED,
+
+ // The probe succeeded, but the proxy was already restricted.
+ SUCCEEDED_PROXY_ALREADY_ENABLED,
+
+ // This must always be last.
+ FETCH_RESULT_COUNT
bengr 2014/01/02 17:30:40 Rename to PROBE_URL_FETCH_RESULT_COUNT?
marq (ping after 24h) 2014/01/02 20:45:47 Done.
+ };
+
} // namespace spdyproxy
// Central point for configuring the data reduction proxy.
@@ -52,6 +85,7 @@ class DataReductionProxySettings
// TODO(marq): Consider instead using a std::pair instead of a vector.
typedef std::vector<GURL> DataReductionProxyList;
+
bengr 2014/01/02 17:30:40 Remove extra blank line.
marq (ping after 24h) 2014/01/02 20:45:47 Done.
DataReductionProxySettings();
virtual ~DataReductionProxySettings();
@@ -172,6 +206,11 @@ class DataReductionProxySettings
// Accessor for unit tests.
std::vector<std::string> BypassRules() { return bypass_rules_;}
+ // Virtualzied for mocking
bengr 2014/01/02 17:30:40 spelling.
marq (ping after 24h) 2014/01/02 20:45:47 Done.
+ virtual void RecordProbeURLFetchResult(spdyproxy::ProbeURLFetchResult result);
+ virtual void RecordStartupState(spdyproxy::ProxyStartupState state);
+
+
private:
friend class DataReductionProxySettingsTestBase;
friend class DataReductionProxySettingsTest;

Powered by Google App Engine
This is Rietveld 408576698