Chromium Code Reviews| Index: net/http/http_cache_transaction.cc |
| diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc |
| index 38da8f3bd7b0fc8a7492cef49a0666fd027c8668..a9c7f775305264c402fa680fd3be314c79b91b49 100644 |
| --- a/net/http/http_cache_transaction.cc |
| +++ b/net/http/http_cache_transaction.cc |
| @@ -2704,6 +2704,27 @@ void HttpCache::Transaction::RecordHistograms() { |
| cache_->mode() != NORMAL || request_->method != "GET") { |
| return; |
| } |
| + |
|
Deprecated (see juliatuttle)
2016/03/22 15:12:47
Have you thought about examining the content-type
jkarlin
2016/03/23 14:54:57
Yes, that's better. Thanks!
|
| + std::string request_path = request_->url.path(); |
| + if (base::EndsWith(request_path, ".js", |
| + base::CompareCase::INSENSITIVE_ASCII)) { |
| + UMA_HISTOGRAM_ENUMERATION("HttpCache.Pattern.JavaScript", |
| + transaction_pattern_, PATTERN_MAX); |
| + } else if (base::EndsWith(request_path, ".css", |
| + base::CompareCase::INSENSITIVE_ASCII)) { |
| + UMA_HISTOGRAM_ENUMERATION("HttpCache.Pattern.CSS", transaction_pattern_, |
| + PATTERN_MAX); |
| + } else if (base::EndsWith(request_path, ".html", |
| + base::CompareCase::INSENSITIVE_ASCII)) { |
| + UMA_HISTOGRAM_ENUMERATION("HttpCache.Pattern.HTML", transaction_pattern_, |
| + PATTERN_MAX); |
| + } else if (base::EndsWith(request_path, ".jpg", |
| + base::CompareCase::INSENSITIVE_ASCII)) { |
| + // .jpg doesn't cover all image types, but this should provide a rough idea |
| + // of the cache patterns of images. |
| + UMA_HISTOGRAM_ENUMERATION("HttpCache.Pattern.JPG", transaction_pattern_, |
| + PATTERN_MAX); |
| + } |
| UMA_HISTOGRAM_ENUMERATION( |
| "HttpCache.Pattern", transaction_pattern_, PATTERN_MAX); |
| if (transaction_pattern_ == PATTERN_NOT_COVERED) |