Commit 48391cd8 authored by ricea's avatar ricea Committed by Commit bot

Add HttpCache.ExternallyConditionalized histogram.

When the Blink cache produces conditional requests, the Chrome cache
always sends them to the origin server without attempting to serve them
from the cache. Add a histogram to find out how common conditional
requests from Blink are, and how many are hitting the network
even though a usable Chrome cache entry exists.

BUG=407968
TEST=manual inspection of about:histograms

Review URL: https://codereview.chromium.org/531693003

Cr-Commit-Position: refs/heads/master@{#293934}
parent baf439d8
...@@ -238,6 +238,13 @@ void RecordNoStoreHeaderHistogram(int load_flags, ...@@ -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
namespace net { namespace net {
...@@ -2226,6 +2233,22 @@ int HttpCache::Transaction::BeginExternallyConditionalizedRequest() { ...@@ -2226,6 +2233,22 @@ 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.
// 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; next_state_ = STATE_SEND_REQUEST;
return OK; return OK;
} }
......
...@@ -9675,6 +9675,16 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -9675,6 +9675,16 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary> </summary>
</histogram> </histogram>
<histogram name="HttpCache.ExternallyConditionalized"
enum="ExternallyConditionalizedType">
<owner>ricea@chromium.org</owner>
<summary>
Count of the number of external (ie. from Blink) conditionalized requests,
and whether or not those requests could have been served from the browser
cache.
</summary>
</histogram>
<histogram name="HttpCache.OfflineStatus" enum="OfflineStatus"> <histogram name="HttpCache.OfflineStatus" enum="OfflineStatus">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner> <owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<summary> <summary>
...@@ -41701,6 +41711,12 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -41701,6 +41711,12 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="7" label="UNINSTALLED (not in webstore)"/> <int value="7" label="UNINSTALLED (not in webstore)"/>
</enum> </enum>
<enum name="ExternallyConditionalizedType" type="int">
<int value="0" label="Cache entry requires validation"/>
<int value="1" label="Cache entry usable"/>
<int value="2" label="Cache entry validators don't match request"/>
</enum>
<enum name="Exynos5250LotIdEnum" type="int"> <enum name="Exynos5250LotIdEnum" type="int">
<int value="0" label="Fused device"/> <int value="0" label="Fused device"/>
<int value="1" label="Generic unfused device"/> <int value="1" label="Generic unfused device"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment