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

Unified Diff: net/http/http_cache_transaction.cc

Issue 1824713002: Break down HTTPCache.Result metric by resource type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698