diff options
-rw-r--r-- | base/histogram.h | 9 | ||||
-rw-r--r-- | net/base/filter.cc | 18 | ||||
-rw-r--r-- | net/base/sdch_filter.cc | 7 | ||||
-rw-r--r-- | net/base/sdch_manager.cc | 2 | ||||
-rw-r--r-- | net/base/sdch_manager.h | 48 |
5 files changed, 57 insertions, 27 deletions
diff --git a/base/histogram.h b/base/histogram.h index af5f1fd..f56d05f 100644 --- a/base/histogram.h +++ b/base/histogram.h @@ -109,6 +109,13 @@ static const int kUmaTargetedHistogramFlag = 0x1; counter.AddTime(sample); \ } while (0) +#define UMA_HISTOGRAM_MEDIUM_TIMES(name, sample) do { \ + static Histogram counter((name), base::TimeDelta::FromMilliseconds(10), \ + base::TimeDelta::FromMinutes(3), 50); \ + counter.SetFlags(kUmaTargetedHistogramFlag); \ + counter.AddTime(sample); \ + } while (0) + // Use this macro when times can routinely be much longer than 10 seconds. #define UMA_HISTOGRAM_LONG_TIMES(name, sample) do { \ static Histogram counter((name), base::TimeDelta::FromMilliseconds(1), \ @@ -199,7 +206,7 @@ class Histogram : public StatsRate { // input the stats counter sees. virtual void Add(int value); - // The following methods provide a graphical histogram displays. + // The following methods provide graphical histogram displays. void WriteHTMLGraph(std::string* output) const; void WriteAscii(bool graph_it, const std::string& newline, std::string* output) const; diff --git a/net/base/filter.cc b/net/base/filter.cc index 433fdcd..3069880 100644 --- a/net/base/filter.cc +++ b/net/base/filter.cc @@ -92,8 +92,19 @@ void Filter::FixupEncodingTypes( return; } - if (!is_sdch_response) + if (!is_sdch_response) { + if (1 < encoding_types->size()) { + // Multiple filters were intended to only be used for SDCH (thus far!) + SdchManager::SdchErrorRecovery( + SdchManager::MULTIENCODING_FOR_NON_SDCH_REQUEST); + } + if ((1 == encoding_types->size()) && + (FILTER_TYPE_SDCH == encoding_types->front())) { + SdchManager::SdchErrorRecovery( + SdchManager::SDCH_CONTENT_ENCODE_FOR_NON_SDCH_REQUEST); + } return; + } // If content encoding included SDCH, then everything is fine. if (!encoding_types->empty() && @@ -103,8 +114,11 @@ void Filter::FixupEncodingTypes( // payload. To handle this gracefully, we simulate the "probably" deleted // ",gzip" by appending a tentative gzip decode, which will default to a // no-op pass through filter if it doesn't get gzip headers where expected. - if (1 == encoding_types->size()) + if (1 == encoding_types->size()) { encoding_types->push_back(FILTER_TYPE_GZIP_HELPING_SDCH); + SdchManager::SdchErrorRecovery( + SdchManager::OPTIONAL_GUNZIP_ENCODING_ADDED); + } return; } diff --git a/net/base/sdch_filter.cc b/net/base/sdch_filter.cc index 46e6af8..ae4d5ac 100644 --- a/net/base/sdch_filter.cc +++ b/net/base/sdch_filter.cc @@ -48,11 +48,12 @@ SdchFilter::~SdchFilter() { // would DCHECK in histogram as the square of the value is summed. The // relatively precise histogram only properly covers the range 1ms to 10 // seconds, so the discarded data would not be that readable anyway. - if (30 >= duration.InSeconds()) { + if (180 >= duration.InSeconds()) { if (DECODING_IN_PROGRESS == decoding_status_) - UMA_HISTOGRAM_TIMES(L"Sdch.Transit_Latency_2", duration); + UMA_HISTOGRAM_MEDIUM_TIMES(L"Sdch.Transit_Latency_M", duration); if (PASS_THROUGH == decoding_status_) - UMA_HISTOGRAM_TIMES(L"Sdch.Transit_Pass-through_Latency_2", duration); + UMA_HISTOGRAM_MEDIUM_TIMES(L"Sdch.Transit_Pass-through_Latency_M", + duration); } } diff --git a/net/base/sdch_manager.cc b/net/base/sdch_manager.cc index 75d0e29..6c5bf92 100644 --- a/net/base/sdch_manager.cc +++ b/net/base/sdch_manager.cc @@ -65,7 +65,7 @@ bool SdchManager::BlacklistDomain(const GURL& url) { if (!global_ ) return false; std::string domain(url.host()); - UMA_HISTOGRAM_TIMES(L"Sdch.UptimeBeforeBlacklisting", + UMA_HISTOGRAM_MEDIUM_TIMES(L"Sdch.UptimeBeforeBlacklisting_M", Time::Now() - FieldTrialList::application_start_time()); global_->blacklisted_domains_.insert(url.host()); return true; diff --git a/net/base/sdch_manager.h b/net/base/sdch_manager.h index 3a8158406..92e5b47 100644 --- a/net/base/sdch_manager.h +++ b/net/base/sdch_manager.h @@ -56,7 +56,7 @@ class SdchManager { enum ProblemCodes { MIN_PROBLEM_CODE, - // Content Decode problems. + // Content-encoding correction problems. ADDED_CONTENT_ENCODING, FIXED_CONTENT_ENCODING, FIXED_CONTENT_ENCODINGS, @@ -65,39 +65,47 @@ class SdchManager { DECODE_HEADER_ERROR, DECODE_BODY_ERROR, + // More content-encoding correction problems. + OPTIONAL_GUNZIP_ENCODING_ADDED, + // Dictionary selection for use problems. DICTIONARY_FOUND_HAS_WRONG_DOMAIN = 10, - DICTIONARY_FOUND_HAS_WRONG_PORT_LIST, - DICTIONARY_FOUND_HAS_WRONG_PATH, - DICTIONARY_FOUND_HAS_WRONG_SCHEME, - DICTIONARY_HASH_NOT_FOUND, - DICTIONARY_HASH_MALFORMED, + DICTIONARY_FOUND_HAS_WRONG_PORT_LIST = 11, + DICTIONARY_FOUND_HAS_WRONG_PATH = 12, + DICTIONARY_FOUND_HAS_WRONG_SCHEME = 13, + DICTIONARY_HASH_NOT_FOUND = 14, + DICTIONARY_HASH_MALFORMED = 15, // Decode recovery methods. - META_REFRESH_RECOVERY, - PASSING_THROUGH_NON_SDCH, - UNRECOVERABLE_ERROR, + META_REFRESH_RECOVERY = 16, + PASSING_THROUGH_NON_SDCH = 17, + UNRECOVERABLE_ERROR = 18, // Dictionary saving problems. DICTIONARY_HAS_NO_HEADER = 20, - DICTIONARY_HEADER_LINE_MISSING_COLON, - DICTIONARY_MISSING_DOMAIN_SPECIFIER, - DICTIONARY_SPECIFIES_TOP_LEVEL_DOMAIN, - DICTIONARY_DOMAIN_NOT_MATCHING_SOURCE_URL, - DICTIONARY_PORT_NOT_MATCHING_SOURCE_URL, - DICTIONARY_HAS_NO_TEXT, + DICTIONARY_HEADER_LINE_MISSING_COLON = 21, + DICTIONARY_MISSING_DOMAIN_SPECIFIER = 22, + DICTIONARY_SPECIFIES_TOP_LEVEL_DOMAIN = 23, + DICTIONARY_DOMAIN_NOT_MATCHING_SOURCE_URL = 24, + DICTIONARY_PORT_NOT_MATCHING_SOURCE_URL = 25, + DICTIONARY_HAS_NO_TEXT = 26, // Dictionary loading problems. DICTIONARY_LOAD_ATTEMPT_FROM_DIFFERENT_HOST = 30, - DICTIONARY_SELECTED_FOR_SSL, - DICTIONARY_ALREADY_LOADED, - DICTIONARY_SELECTED_FROM_NON_HTTP, - DICTIONARY_IS_TOO_LARGE, - DICTIONARY_COUNT_EXCEEDED, + DICTIONARY_SELECTED_FOR_SSL = 31, + DICTIONARY_ALREADY_LOADED = 32, + DICTIONARY_SELECTED_FROM_NON_HTTP = 33, + DICTIONARY_IS_TOO_LARGE= 34, + DICTIONARY_COUNT_EXCEEDED = 35, // Failsafe hack. ATTEMPT_TO_DECODE_NON_HTTP_DATA = 40, + + // Content-Encoding problems detected, with no action taken. + MULTIENCODING_FOR_NON_SDCH_REQUEST = 50, + SDCH_CONTENT_ENCODE_FOR_NON_SDCH_REQUEST = 51, + MAX_PROBLEM_CODE // Used to bound histogram. }; |