From 5b90b5d3473f3f846618092e79d4c5fcff7d3969 Mon Sep 17 00:00:00 2001 From: "jar@chromium.org" Date: Thu, 30 Apr 2009 23:06:01 +0000 Subject: Hand craft an A/B test of SDCH compression After we're sure we can do SDCH compression to a given URL, toss a 50-50 coin each time we have a chance to advertise SDCH, and either completely avoid advertisement, or advertise (including the dictionary). Histogram both compression download times, as well as the download times for the "completely avoid" case. http://crbug.com/11236 bug=11236 r=wtc,openvcdiff Review URL: http://codereview.chromium.org/100004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15010 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/sdch_manager.h | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'net/base/sdch_manager.h') diff --git a/net/base/sdch_manager.h b/net/base/sdch_manager.h index 6524e7a..e8329e1 100644 --- a/net/base/sdch_manager.h +++ b/net/base/sdch_manager.h @@ -130,13 +130,16 @@ class SdchManager { // (i.e., be able to be sure all dictionary advertisements are accounted // for). - UNFLUSHED_CONTENT = 90, // Possible error in filter chaining. - MISSING_TIME_STATS = 91, // Should never happen. - CACHE_DECODED = 92, // No timing stats recorded. - OVER_10_MINUTES = 93, // No timing stats will be recorded. - UNINITIALIZED = 94, // Filter never even got initialized. - PRIOR_TO_DICTIONARY = 95, // We hadn't even parsed a dictionary selector. - DECODE_ERROR = 96, // Something went wrong during decode. + UNFLUSHED_CONTENT = 90, // Possible error in filter chaining. + // defunct = 91, // MISSING_TIME_STATS (Should never happen.) + CACHE_DECODED = 92, // No timing stats recorded. + // defunct = 93, // OVER_10_MINUTES (No timing stats recorded.) + UNINITIALIZED = 94, // Filter never even got initialized. + PRIOR_TO_DICTIONARY = 95, // We hadn't even parsed a dictionary selector. + DECODE_ERROR = 96, // Something went wrong during decode. + + // Problem during the latency test. + LATENCY_TEST_DISALLOWED = 100, // SDCH now failing, but it worked before! MAX_PROBLEM_CODE // Used to bound histogram. }; @@ -302,8 +305,17 @@ class SdchManager { static void GenerateHash(const std::string& dictionary_text, std::string* client_hash, std::string* server_hash); + // For Latency testing only, we need to know if we've succeeded in doing a + // round trip before starting our comparative tests. If ever we encounter + // problems with SDCH, we opt-out of the test unless/until we perform a + // complete SDCH decoding. + bool AllowLatencyExperiment(const GURL& url) const; + + void SetAllowLatencyExperiment(const GURL& url, bool enable); + private: - typedef std::map DomainCounter; + typedef std::map DomainCounter; + typedef std::set ExperimentSet; // A map of dictionaries info indexed by the hash that the server provides. typedef std::map DictionaryMap; @@ -334,6 +346,10 @@ class SdchManager { // blacklisting expires. DomainCounter exponential_blacklist_count; + // List of hostnames for which a latency experiment is allowed (because a + // round trip test has recently passed). + ExperimentSet allow_latency_experiment_; + DISALLOW_COPY_AND_ASSIGN(SdchManager); }; -- cgit v1.1