diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-28 21:54:05 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-28 21:54:05 +0000 |
commit | f61ba8cfb9b5ef812c131de7860433cd832a60ff (patch) | |
tree | 5307d57a3b551f2f492ee1d52d98d99141ebb617 /net | |
parent | d81c29317d2c1079c5535f4c29fefccc48231c53 (diff) | |
download | chromium_src-f61ba8cfb9b5ef812c131de7860433cd832a60ff.zip chromium_src-f61ba8cfb9b5ef812c131de7860433cd832a60ff.tar.gz chromium_src-f61ba8cfb9b5ef812c131de7860433cd832a60ff.tar.bz2 |
Http cache: Remove a histogram.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6021009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70240 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/http/http_cache_transaction.cc | 56 | ||||
-rw-r--r-- | net/http/http_cache_transaction.h | 3 |
2 files changed, 13 insertions, 46 deletions
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc index 923ee25..d795c83 100644 --- a/net/http/http_cache_transaction.cc +++ b/net/http/http_cache_transaction.cc @@ -354,6 +354,19 @@ int HttpCache::Transaction::WriteMetadata(IOBuffer* buf, int buf_len, callback, true); } +// Histogram data from the end of 2010 show the following distribution of +// response headers: +// +// Content-Length............... 87% +// Date......................... 98% +// Last-Modified................ 49% +// Etag......................... 19% +// Accept-Ranges: bytes......... 25% +// Accept-Ranges: none.......... 0.4% +// Strong Validator............. 50% +// Strong Validator + ranges.... 24% +// Strong Validator + CL........ 49% +// bool HttpCache::Transaction::AddTruncatedFlag() { DCHECK(mode_ & WRITE); @@ -688,8 +701,6 @@ int HttpCache::Transaction::DoSuccessfulSendRequest() { return OK; } - HistogramHeaders(new_response->headers); - // Are we expecting a response to a conditional query? if (mode_ == READ_WRITE || mode_ == UPDATE) { if (new_response->headers->response_code() == 304 || @@ -1857,47 +1868,6 @@ int HttpCache::Transaction::DoPartialCacheReadCompleted(int result) { return result; } -// For a 200 response we'll add a histogram with one bit set per header: -// 0x01 Content-Length -// 0x02 Date -// 0x04 Last-Modified -// 0x08 Etag -// 0x10 Accept-Ranges: bytes -// 0x20 Accept-Ranges: none -// -// TODO(rvargas): remove after having some results. -void HttpCache::Transaction::HistogramHeaders( - const HttpResponseHeaders* headers) { - if (headers->response_code() != 200) - return; - - int64 content_length = headers->GetContentLength(); - int value = 0; - if (content_length > 0) - value = 1; - - Time date; - if (headers->GetDateValue(&date)) - value += 2; - if (headers->GetLastModifiedValue(&date)) - value += 4; - - std::string etag; - headers->EnumerateHeader(NULL, "etag", &etag); - if (!etag.empty()) - value += 8; - - std::string accept_ranges("Accept-Ranges"); - if (headers->HasHeaderValue(accept_ranges, "bytes")) - value += 0x10; - if (headers->HasHeaderValue(accept_ranges, "none")) - value += 0x20; - - // |value| goes from 0 to 63. Actually, the max value should be 47 (0x2f) - // but we'll see. - UMA_HISTOGRAM_ENUMERATION("HttpCache.ResponseHeaders", value, 65); -} - void HttpCache::Transaction::OnIOComplete(int result) { DoLoop(result); } diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h index bc0b211..6b46750 100644 --- a/net/http/http_cache_transaction.h +++ b/net/http/http_cache_transaction.h @@ -312,9 +312,6 @@ class HttpCache::Transaction : public HttpTransaction { // working with range requests. int DoPartialCacheReadCompleted(int result); - // Sends a histogram with info about the response headers. - void HistogramHeaders(const HttpResponseHeaders* headers); - // Called to signal completion of asynchronous IO. void OnIOComplete(int result); |