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

Unified Diff: net/http/http_cache_transaction.cc

Issue 6021009: Http cache: Remove a histogram. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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
« no previous file with comments | « net/http/http_cache_transaction.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_transaction.cc
===================================================================
--- net/http/http_cache_transaction.cc (revision 69919)
+++ net/http/http_cache_transaction.cc (working copy)
@@ -354,6 +354,19 @@
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 @@
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 @@
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);
}
« no previous file with comments | « net/http/http_cache_transaction.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698