diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-16 19:04:19 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-16 19:04:19 +0000 |
commit | d8c3a46da9b82be3997d619f4f3d5dd32a8c69f3 (patch) | |
tree | c72feb0775f520031ca5edb3ebd1e2c688b8ce23 /net | |
parent | 00f93a6e497bf687e9c28030bd65e142401ee0aa (diff) | |
download | chromium_src-d8c3a46da9b82be3997d619f4f3d5dd32a8c69f3.zip chromium_src-d8c3a46da9b82be3997d619f4f3d5dd32a8c69f3.tar.gz chromium_src-d8c3a46da9b82be3997d619f4f3d5dd32a8c69f3.tar.bz2 |
Implement A/B experiment for anti-DDoS.
BUG=85258
TEST=manual testing done by developer
Review URL: http://codereview.chromium.org/7027040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89376 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/url_request/url_request_throttler_entry.cc | 19 | ||||
-rw-r--r-- | net/url_request/url_request_throttler_manager.cc | 4 |
2 files changed, 12 insertions, 11 deletions
diff --git a/net/url_request/url_request_throttler_entry.cc b/net/url_request/url_request_throttler_entry.cc index ca29fe0..bf831ca 100644 --- a/net/url_request/url_request_throttler_entry.cc +++ b/net/url_request/url_request_throttler_entry.cc @@ -199,9 +199,10 @@ bool URLRequestThrottlerEntry::IsDuringExponentialBackoff() const { int reject_count = reject_request ? 1 : 0; UMA_HISTOGRAM_ENUMERATION( "Throttling.RequestThrottled", reject_count, 2); - if (base::FieldTrialList::TrialExists("ThrottlingEnabled")) { + if (base::FieldTrialList::TrialExists("HttpThrottlingEnabled")) { UMA_HISTOGRAM_ENUMERATION(base::FieldTrial::MakeName( - "Throttling.RequestThrottled", "ThrottlingEnabled"), reject_count, 2); + "Throttling.RequestThrottled", "HttpThrottlingEnabled"), + reject_count, 2); } return reject_request; @@ -367,10 +368,10 @@ void URLRequestThrottlerEntry::HandleCustomRetryAfter( UMA_HISTOGRAM_CUSTOM_TIMES( "Throttling.CustomRetryAfterMs", value, base::TimeDelta::FromSeconds(1), base::TimeDelta::FromHours(12), 50); - if (base::FieldTrialList::TrialExists("ThrottlingEnabled")) { + if (base::FieldTrialList::TrialExists("HttpThrottlingEnabled")) { UMA_HISTOGRAM_CUSTOM_TIMES( base::FieldTrial::MakeName("Throttling.CustomRetryAfterMs", - "ThrottlingEnabled"), value, + "HttpThrottlingEnabled"), value, base::TimeDelta::FromSeconds(1), base::TimeDelta::FromHours(12), 50); } } @@ -393,10 +394,10 @@ void URLRequestThrottlerEntry::HandleMetricsTracking(int response_code) { // to make sure we count only the responses seen by throttling. // TODO(joi): Remove after experiment. UMA_HISTOGRAM_ENUMERATION("Throttling.HttpResponseCode", response_code, 600); - if (base::FieldTrialList::TrialExists("ThrottlingEnabled")) { + if (base::FieldTrialList::TrialExists("HttpThrottlingEnabled")) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("Throttling.HttpResponseCode", - "ThrottlingEnabled"), + "HttpThrottlingEnabled"), response_code, 600); } @@ -419,12 +420,12 @@ void URLRequestThrottlerEntry::HandleMetricsTracking(int response_code) { base::TimeDelta::FromMilliseconds(10), base::TimeDelta::FromHours(6), 50); - if (base::FieldTrialList::TrialExists("ThrottlingEnabled")) { + if (base::FieldTrialList::TrialExists("HttpThrottlingEnabled")) { UMA_HISTOGRAM_COUNTS(base::FieldTrial::MakeName( - "Throttling.FailureCountAtSuccess", "ThrottlingEnabled"), + "Throttling.FailureCountAtSuccess", "HttpThrottlingEnabled"), failure_count); UMA_HISTOGRAM_CUSTOM_TIMES(base::FieldTrial::MakeName( - "Throttling.PerceivedDowntime", "ThrottlingEnabled"), down_time, + "Throttling.PerceivedDowntime", "HttpThrottlingEnabled"), down_time, base::TimeDelta::FromMilliseconds(10), base::TimeDelta::FromHours(6), 50); } diff --git a/net/url_request/url_request_throttler_manager.cc b/net/url_request/url_request_throttler_manager.cc index aaa03af..1bbad1f 100644 --- a/net/url_request/url_request_throttler_manager.cc +++ b/net/url_request/url_request_throttler_manager.cc @@ -89,9 +89,9 @@ void URLRequestThrottlerManager::AddToOptOutList(const std::string& host) { // In practice, this would almost never occur. if (opt_out_hosts_.find(host) == opt_out_hosts_.end()) { UMA_HISTOGRAM_COUNTS("Throttling.SiteOptedOut", 1); - if (base::FieldTrialList::TrialExists("ThrottlingEnabled")) { + if (base::FieldTrialList::TrialExists("HttpThrottlingEnabled")) { UMA_HISTOGRAM_COUNTS(base::FieldTrial::MakeName( - "Throttling.SiteOptedOut", "ThrottlingEnabled"), 1); + "Throttling.SiteOptedOut", "HttpThrottlingEnabled"), 1); } net_log_->EndEvent( |