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

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: Add MISMATCHED_VALIDATORS option to the enum. 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..ab90ad11536a3f73c8566c42cb092853dc0ba2f8 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -238,6 +238,13 @@ void RecordNoStoreHeaderHistogram(int load_flags,
}
}
+enum ExternallyConditionalizedType {
+ EXTERNALLY_CONDITIONALIZED_CACHE_REQUIRES_VALIDATION,
+ EXTERNALLY_CONDITIONALIZED_CACHE_USABLE,
+ EXTERNALLY_CONDITIONALIZED_MISMATCHED_VALIDATORS,
+ EXTERNALLY_CONDITIONALIZED_MAX
+};
+
} // namespace
namespace net {
@@ -2226,6 +2233,21 @@ 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.
+ ExternallyConditionalizedType type =
+ EXTERNALLY_CONDITIONALIZED_CACHE_USABLE;
+ if (mode_ == NONE)
+ type = EXTERNALLY_CONDITIONALIZED_MISMATCHED_VALIDATORS;
+ else if (RequiresValidation())
+ type = EXTERNALLY_CONDITIONALIZED_CACHE_REQUIRES_VALIDATION;
+ // TODO(ricea): Add CACHE_USABLE_STALE once stale-while-revalidate CL landed.
rvargas (doing something else) 2014/09/04 19:33:20 tiny nit: Please add an empty line above this line
Adam Rice 2014/09/05 05:49:29 Done.
+ // TODO(ricea): Either remove this histogram or make it permanent by M40.
+ UMA_HISTOGRAM_ENUMERATION("HttpCache.ExternallyConditionalized",
+ type,
+ EXTERNALLY_CONDITIONALIZED_MAX);
+
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