Chromium Code Reviews

Issue 6021009: Http cache: Remove a histogram. (Closed)

Created:
10 years ago by rvargas (doing something else)
Modified:
9 years, 6 months ago
Reviewers:
eroman
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Http cache: Remove a histogram. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=70240

Patch Set 1 #

Unified diffs Side-by-side diffs Stats (+13 lines, -46 lines)
M net/http/http_cache_transaction.h View 1 chunk +0 lines, -3 lines 0 comments
M net/http/http_cache_transaction.cc View 3 chunks +13 lines, -43 lines 0 comments

Messages

Total messages: 2 (0 generated)
rvargas (doing something else)
10 years ago (2010-12-23 23:49:11 UTC) #1
eroman
10 years ago (2010-12-24 00:05:50 UTC) #2
LGTM.

Be sure to also update (tools/histograms/histograms.xml) as a follow-up.

On Thu, Dec 23, 2010 at 3:49 PM,  <rvargas@chromium.org> wrote:
> Reviewers: eroman,
>
> Description:
> Http cache: Remove a histogram.
>
> BUG=none
> TEST=none
>
>
> Please review this at http://codereview.chromium.org/6021009/
>
> SVN Base: svn://svn.chromium.org/chrome/trunk/src/
>
> Affected files:
>  M     net/http/http_cache_transaction.h
>  M     net/http/http_cache_transaction.cc
>
>
> 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);
>  }
> Index: net/http/http_cache_transaction.h
> ===================================================================
> --- net/http/http_cache_transaction.h   (revision 69919)
> +++ net/http/http_cache_transaction.h   (working copy)
> @@ -312,9 +312,6 @@
>   // 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);
>
>
>
>

Powered by Google App Engine