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

Unified Diff: net/http/http_cache_transaction.cc

Issue 531693003: Add HttpCache.ExternallyConditionalized histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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') | no next file with comments »
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 edc638905881acc3c46af34049c109050a37ea70..46d9b848cbf2c485ce189c5348071b35e694c150 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -238,6 +238,22 @@ void RecordNoStoreHeaderHistogram(int load_flags,
}
}
+// TODO(ricea): Add CACHE_USABLE_STALE once stale-while-revalidate CL landed.
+// TODO(ricea): Either remove this histogram or make it permanent by M40.
+void RecordExternallyConditionalizedHistogram(bool requires_validation) {
+ enum ExternallyConditionalizedType {
+ EXTERNALLY_CONDITIONALIZED_CACHE_REQUIRES_VALIDATION,
+ EXTERNALLY_CONDITIONALIZED_CACHE_USABLE,
+ EXTERNALLY_CONDITIONALIZED_MAX
+ };
+ ExternallyConditionalizedType type =
+ requires_validation ? EXTERNALLY_CONDITIONALIZED_CACHE_REQUIRES_VALIDATION
+ : EXTERNALLY_CONDITIONALIZED_CACHE_USABLE;
+ UMA_HISTOGRAM_ENUMERATION("HttpCache.ExternallyConditionalized",
+ type,
+ EXTERNALLY_CONDITIONALIZED_MAX);
+}
+
} // namespace
namespace net {
@@ -2226,6 +2242,11 @@ int HttpCache::Transaction::BeginExternallyConditionalizedRequest() {
}
}
+ // TODO(ricea): This calculation is expensive to perform just to collect
+ // statistics. Either remove it or use the result, depending on the result of
+ // the experiment.
+ RecordExternallyConditionalizedHistogram(RequiresValidation());
+
next_state_ = STATE_SEND_REQUEST;
return OK;
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698